Click here to Skip to main content
15,890,123 members
Everything / Cmd

Cmd

cmd

Great Reads

by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
by Michael Haephrati
A tiny Command Line Interface wrapped with a Graphic User Interface
by BillMoore2017
Tkinter Command Window Here Launcher
by Grant Curell
Pentesting: Runas

Latest Articles

by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
by Michael Haephrati
A tiny Command Line Interface wrapped with a Graphic User Interface
by BillMoore2017
Tkinter Command Window Here Launcher
by Grant Curell
Pentesting: Runas

All Articles

Sort by Updated

Cmd 

10 Feb 2016 by 7prasannaReddy
All I need is to open a cmd prompt and pass commands to cmd prompt and run them.For example 1.open cmd2.pass a command to "change directory"3.pass a command to open a file.What I have tried:I've tried as below:#include int main(){ std::cout
19 Jan 2016 by _Asif_
Try this,echo Offsetlocal ENABLEEXTENSIONSset KEY_NAME="HKLM\SYSTEM\CurrentControlSet\services\MA Service"set VALUE_NAME=DBServer echo %VALUE_NAME%echo %KEY_NAME%FOR /F "tokens=2* delims= " %%A IN ('REG QUERY %KEY_NAME% /v %VALUE_NAME%') DO SET TMP=%%BECHO...
9 Feb 2022 by _Asif_
An excerpt from Run R script from command line - Stack Overflow[^] If you want the output to print to the terminal it is best to use Rscript Rscript a.R Note that when using R CMD BATCH a.R that instead of redirecting output to standard out...
5 May 2016 by _ProgProg_
Dears,I 've a problem with creating event log on event viewer.The issue is as following:I am using this code to create event log in event viewer.private static void WriteEventLogEntry(string message) { try { try { if...
25 Feb 2015 by Abdulnazark
do zip by sql agent job onlysee link:http://searchsqlserver.techtarget.com/tip/ZIP-files-with-a-stored-procedure
15 Apr 2015 by Abhinav S
Try string output = p.StandardOutput.ReadToEnd() + " " + DateTime.Now.MilliSeconds;
19 Jan 2016 by Abhinav S
One way would be to use for loop with do set.Try this thread for samples -http://www.tomshardware.com/forum/230090-45-windows-batch-file-output-program-variable[^]
10 Sep 2015 by Abhishek Kumar Goswami
Yes , you can use visual studio 2013 , but make sure , sometime it wont convert all the files which are having some problem so those files , either you can add explicitly or make them compatible and add.Cheers
23 Dec 2015 by AD89
I m developing a windows application that will use pdf2text pilot software which supports command line. In this application user needs to specify location of the pdf file. I m able to open cmd but could not pass commands to it or somehow my commands are not getting executed.Imports...
13 Apr 2015 by AdamASPGeek
Hi Pradeep,It will be easier to use FTP to upload your files. Here are steps to publish your web application using FTP:1. Open your project via Visual Studio tool2. On the Solution Explorer window, right click your project and select "Publish Website"3. Please publish your...
11 Jun 2015 by agent_kruger
I have batch file in "D:\run.bat". in this batch file i wanted to write a line so that whenever i run this file, a file should be created in the same folder with name "README.txt"Example:-batch file locationE:\run.batnew file generated locationE:\README.txtI am new to batch file....
8 May 2021 by agent_kruger
I have a batch file in which i want to write some code which kills a particular app named "AMPPSS.exe" and wait until the process is dead and after the application is killed creates a file named "DONE".I am new at using batch file. so, please help me if possibleThanks in advance
16 Apr 2018 by Ahmed AE
I am trying to execute a command in the command line prompt. This command is sent from c++. If i am trying to execute 3 command, only 2 is executed and the third is not returned to c++. Here is what i am trying to execute: wmic diskdrive get serialnumber& wmic cpu get ProcessorId& wmic os get...
2 Jul 2019 by AkashDaniel
Hi I am creating a setup in visual studio. Is there anyway to download and install sdelete.exe directly while i am creating a setup in visual studio What I have tried: I am creating a setup in visual studio. Is there anyway to download and install sdelete.exe directly while i am creating a...
23 May 2023 by Andre Oosthuizen
Been here before, it seems that your file system permissions or log file creation for the IIS app pool running the Node.js app is the culprit. You can try the following if not yet done - Check that the identity of the IIS app pool assigned to...
22 Jul 2014 by Aravindba
Hi I need to change that server ip,subnet,gateway,dns using netsh cmd using cmd line in vb,somebody give netsh cmd for remote login system(using username and password).Before,Netsh can use in all OS (win7,win8,win 8.1) or restricted to some OS.netsh -r Admin-pc -u...
23 Dec 2014 by Aravindba
Hi All How to install service form VS 2012 Developer Command Prompt,My service project available in D:\MyService\MyService\bin\Release\MyService.exeMy InstallUtil available in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\InstallUtil.exei am build service and get service exe inside...
21 Apr 2015 by Armand Peens
Hi I am struggling to run a 32 bit app from 64 bit Windows Server 2012. When I set it up in task scheduler it never runs. Any suggestions to the following? Thanks.If the Application (which you are trying to schedule) is 32-bit then try launching it from the 32-bit CLI, i.e. if you want to...
18 Aug 2015 by barneyman
i think you misunderstand services and scsc create makes the registry changes necessary to run a properly compiled windows service.exe, it does *nothing* to create that service.exe for youyou can't just make a normal exe run as a service (alwaysUp is cheating because *it* runs as a...
20 Nov 2016 by Bernhard Hiller
The C# command to set the Curren Directory is:Directory.SetCurrentDirectory(folder);Assuming that you analysed the problem correctly (there is some doubt), call that before you start the cmd process.
30 Oct 2014 by Bhagyashree Chaudhari - Member 10473634
I am new in VbScript , and i want to vbscript which will copy zip file and extract it.i have used this codeSub ExtractFile(objFSO,lastImportDate,zipFilePath) DIM subFolderPath subFolderPath = "\developer\" DIM dumpFile dumpFile = "fichero.dump" Dim extractTo extractTo...
3 Nov 2014 by Bhagyashree Chaudhari - Member 10473634
Here i just do theseDim objShellset objShell = CreateObject("Shell.Application")objShell.NameSpace(extractTo).CopyHere objShell.NameSpace(extractFrom).Itemsinstead of theseset objShell = CreateObject("Shell.Application")set...
31 May 2017 by BillMoore2017
Tkinter Command Window Here Launcher
11 Dec 2014 by BillWoodruff
// required in addition to other 'using necessaryusing System.Diagnostics;using System.IO;private void OpenFolder(string folderPath){ if (Directory.Exists(folderPath)) { ProcessStartInfo startInfo = new ProcessStartInfo { Arguments =...
14 Jan 2016 by BillWoodruff
Assuming you have PowerShell installed: [^], you can take a screen shot from the command-line.See the answers to the following question on StackOverFlow: [^].You can find discussion of, and links to, several other 3rd. party tools that can be installed and then used from the command-line...
7 Apr 2022 by Chris Maunder
A quick overview and a simple Windows CMD script to make your terminal output a little more lively
18 Oct 2023 by Chris Maunder
My article How to Change Text Color in a Windows Terminal[^] covers this and provides the code you need.
20 Jun 2018 by Clifford Nelson
You really should also be creating a method to execute the process. That way you can wrap it appropriately, and not duplicate code. Here is some code I found and slightly modified: public static void RunCmd(string executeString) { ProcessStartInfo processStartInfo =...
29 Jul 2014 by Coder93
I want to check my SQLite database which I create it in my java code. I have downloaded sqlite3,sqlite3.def,sqlite3.dll , but I don't know the exact place for them!how can I check my SQLite database and its table with cmd?
10 Mar 2020 by CPallini
Have a look at this page: batch search for windows drive letter, if exists set as variable and execute command, else try another letter - Stack Overflow[^].
30 Jun 2021 by CPallini
Quote: system("reg add HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\CentralProcessor\ /v TEST /t REG_SZ /d CPU Name"); The backslash is the escape character in C/C++ strings, and it must be escaped as well. Replace every occurrence of \, in...
11 Dec 2014 by DamithSL
you can try by executing run command as below System.Diagnostics.Process process = new System.Diagnostics.Process();System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();startInfo.WindowStyle =...
21 Sep 2015 by Dave Kreskowiak
First, those are not environment variables. Those names don't exist by default, unless you've got some login script that are setting them.What you SHOULD be doing is assembling the fully qualified paths to these files using known starting points. What you're using in your examples are not...
14 Jan 2016 by Dave Kreskowiak
There is no command you can type in a CMD box that will take a screenshot without using a 3rd party tool to do it.
16 Feb 2016 by Dave Kreskowiak
You cannot protect a BAT file at all. It won't run as anything other than a normal text file.VBScript can be done, albeit not that securely, using the Script Encoder built into the Windows Script host can help a bit. You can find an example here[^].Overall, if protecting the code was a...
5 May 2016 by Dave Kreskowiak
Creating an event source requires administrator permissions. This is something that is normally done at install time, by your installer, not at application run time.You can only create an event in one log at a time. If you want an event to show up in multiple logs you have to create...
17 Jun 2016 by Dave Kreskowiak
The user you impersonate has to have permissions to the network share you're trying to open the file from.Also, a UNC path is \\servername\sharename\folderpath\filename
21 Oct 2016 by Dave Kreskowiak
If all you're doing is betting the free space of a remote drive, why are you even using a batch file? Just use the methods built into Windows and the .NET Framework, such as this example that uses WMI to do it[^].In that example, you replace "Remote_Computer" with the IP address.
22 May 2017 by Dave Kreskowiak
Windows doesn't have any utilities to give you this information since it is unattainable. There are simply too many variables to eliminate between the machine and the server that can affect the bandwidth of the route. The target server would have to be specifically setup to run a test like...
14 Apr 2018 by Dave Kreskowiak
Why are you even shelling out to wmic to run the queries? Run the queries directly yourself. WMI C++ Application Examples (Windows)[^]
20 Jun 2018 by Dave Kreskowiak
You're not paying attention to the spaces in between your command line arguments. Your assembled command line looks like this: cmd.exe /cC:\ant.bat-f=C:\build.xml-DinputFile=C:\Book1.xml-DstartDate=2018-05-23-dXslFile=2018-05-23-DoutputFile=ff Just concatenating strings together does not...
25 Jul 2018 by Dave Kreskowiak
There's nothing you can put into the registry that's going to do the whole "If there's something on the clipboard" thing. You're going to have to provide actual code for that and modify the context menu on-the-fly. The only way to do that is to write a shell extension. This is FAR from a...
28 Sep 2018 by Dave Kreskowiak
You can't. The CMD prompt will only work with the file system. Your application is not part of the file system, so CMD cannot see what's inside the compiled app and use it as if it was. The only way CMD can get to the batch file and run it is if it is a separate file that shows up in a folder...
9 Feb 2019 by Dave Kreskowiak
You're going to have to write an application to load the web site and do the "clicking". There's nothing you can put into a batch file that will click a link.
24 May 2020 by Dave Kreskowiak
I don't think you have any options to that in .NET Core. The System.Management namespace will only work on Windows. Now, if the Process you want to start is an interactive one, meaning you're expecting the process to show up on the desktop of...
28 Apr 2021 by Dave Kreskowiak
Why would you copy a file to more than one folder? That seems like a waste of disk space and sounds like it's bordering on a bad idea. But, there may be some legit reason for doing it. The command line tools will only target one destination...
1 Jun 2021 by Dave Kreskowiak
Why are you trying to do this with a web application? Just write a small console app to do the work and run that from the Windows Scheduler.
16 Sep 2022 by Dave Kreskowiak
What you're asking is so obscure, I doubt you'll get an answer for it from anyone other than Microsoft Support.
3 Mar 2023 by Dave Kreskowiak
You can't. There is no tool that comes with Windows that will export anything other than an entire key and all of its sub-keys and values. You cannot export a single value. You would have to write your own tool to do that.
17 Aug 2023 by Dave Kreskowiak
Which version of Windows are you running? You may be able to recover it by right-clicking the Data folder and clicking on the Previous Versions tab, if it's there. If the tab is not present, you'll have to install an undelete tool to recover the...
10 Feb 2018 by David_Wimbley
The error is pretty clear...your URL of http://servername/_layouts/MyFirstWebService.asmx doesn't exist. I imagine it has something to do with "servername" as that doesn't seem like a valid domain name. Should that be correct, your URL you provided as what you are following indicates the URL...
25 Mar 2023 by Dinesh Kumar Dora
How can i export only a single reg entry from a reg key? I dont need all the subkeys or entries or values to be exported. Just a specific single reg entry. I tried reg export but it exports the whole reg key with whole reg subkeys and other...
27 Jan 2024 by dj4400
Hi all I run a batch file which runs the same application numerous times with variable parameters between each run it requires any key to be presses How do i mimic the space bar hit in the cmd line? the batch file looks like this: c: cd "C:\My...
11 Feb 2016 by E.F. Nijboer
You would need to have a Main method in your application, just like in the c# code. Main Procedure in Visual Basic[^]Or you could get the commandline arguments using My.Application.CommandLineArgsGood luck!
10 Aug 2017 by evaboy
ping -arp google.com works as ping -a google.com My question is what is the meaning of -arp since it is not in the command prompt documentation? What I have tried: ping -a google.com Am confused in both commands because l want to know which one is better.
28 Sep 2018 by evaboy
Help me, l wrote a java program and l added a aapt.bat file in a folder(as a reseource) in the same program. l want the aapt.bat run using command prompt. The application runs fine from the IDE but when l compiled the application to a .jar file and run it, l get error as below from the command...
24 Oct 2016 by Evosoul04
I found an answer at this link: Answer[^]The accepted answer worked for me
16 Feb 2019 by faizanza
Hi, im working on a personal project that opens other programs and currently I am using a text file where I have to manually enter the path to the exe file like this C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe I wanted to know is there a way to get a list of all the...
6 Nov 2017 by Felix Mensah
I am using visual studio 2017 for my c++ project and had this error on the command line when trying to compile the program. Error message was: path is not recognized as an internal or external command. Any assistance is highly appreciated. What I have tried: #include using...
24 May 2023 by Gaby94
I'm trying to make an auto installer in command prompt for an app (FUXA : https://github.com/frangoteam/FUXA ). Everything works fine until I reboot the machine that was installed on, after that it gives me this error in the browser: iisnode...
1 Jun 2021 by gacar
I need daily save some data to archive (Json), on windows server. I can create .cmd file and it work with scheduler task, but i dont want open browser on server. How can run .cs or .vb file via .cmd file without open browser? (what could be...
30 Oct 2014 by Garth J Lancaster
wouldn't you be better off asking this in an EMC support channel ? (or even doing a quick google) - the EMC Navisphere CLI manual is 500pages give or take, the chances of anyone here knowing what you're talking about are fairly remote if anything, I would be using the 'getcrus' function, and...
10 Sep 2015 by Garth J Lancaster
I don't know about a command line tool, but (usually) if you open an earlier solution file in a newer version of Visual Studio, it will convert it - so opening your VS2010 Solution in VS2013 Will convert that solution and its projects to VS2013 and make backups iirc
30 Oct 2014 by Gary Sun
hi,all! I want to use Navisphere CLI to get alarm information.I have already Installed NaviCLI-Win-32-x86-en_US-7.33.3.0.72-1.exe,my difficulty is that I dont't konw how to write a command line to get EMC alarm information,could you give me some advice?
13 Sep 2014 by George Jonsson
Maybe this can be of some help.7-Zip Command-Line[^]Command Line Syntax[^]Extract the file>7za e -tzip ddd.zip 1\2\A.txtAdd a file to a specific directoryCreate the wanted directory structure in the directory where ddd.zip is located.Example: If ddd.zip is located in...
3 Apr 2019 by Gerry Schmitz
.net - File / folder chooser dialog from a Windows batch script - Stack Overflow[^] Neat Dialog Boxes in Batch Files[^]
1 Jun 2021 by Gerry Schmitz
Run DOM-based Javascript from command line - Stack Overflow[^]
6 Sep 2017 by Graeme_Grant
Must it be a batch file? Powershell[^] does this very easily... How to close all windows with PowerShell - Stack Overflow[^]
2 Sep 2016 by Grant Curell
Pentesting: Runas
7 Sep 2017 by Hackoo
Check this answer here on stackoverflow batch file - Close All Program Except these with CMD - Stack Overflow[^]
17 Nov 2014 by Hari-CodeBlogger
I was asked to work on WCAT stress test tool. I downloaded that and tried with samples files i got but couldn't get a proper test results. If Someone have done that before , please get me a sample file and the cmd line to execute it.Thanks in advance
12 Jan 2023 by huynhminh97
I want to run a batch file which set in task scheduler without display console window, my batch need open one wpf app at the end. I tried to set Security Options in task scheduler like this https://i.stack.imgur.com/IgfjU.png, the console window...
14 Nov 2018 by ilostmyid2
remember ansi.sys? colorful prompts are not supported anymore! unless with some tools like ansicon. anyway, i need to know how can i go to the beginning of the next line. what is its ansi escape sequence? i need my prompt to be like: path > so that what i type appear from the beginning of the...
21 May 2015 by iProgramIt
Hi guys,So, I was wondering if it was possible to get open cmd, then tell it to open my vb.net console, but within the command prompt window, instead as a new instance? If you guys could help me accomplish that, I would be very grateful.Regards, iProgramIt
21 Sep 2015 by JamesHadleyChase
Hi,I have this basic question, (probably stupid !!)I am trying to run a batch file from the "Run dialog" on Win 7 and XP.Currently, at the run window, I am typing in "cmd.exe /k c:\users\myuser\Desktop\mybatch.bat"However, Instead of typing in the fully qualified path to the batch...
15 Apr 2015 by Jamie888
Hi, I am trying to get the net time using command prompt. Inside the CMD, I use "net time" and it return me the result "Current time at......9:53:45 AM" without the milliseconds. How can I include the milliseconds?FYI, I will retrieve the results I get using C# codes. Below are my codes in...
16 Apr 2015 by Jamie888
Hi, may I ask the difference between echo time and net time? Is the time returned using "echo time" a local PC time and whereas "net time" is server time?I have tried search from the Internet but I can't seem to find the answer I want.Any input is appreciated.Thank you.
16 Apr 2015 by Jamie888
Hi, I am using command prompt and I entered the following command:--> NET TIMEIt returned me the following message:Current time at......is 2:09:45 PMThe command completed successfully.As from the message above, the time do not have milliseconds. How can I include also the...
19 Apr 2015 by Jamie888
Hi, I am using command prompt and I entered the following command:--> NET TIMEIt returned me the following message:Current time at......is 2:09:45 PMThe command completed successfully.As from the message above, the time do not have milliseconds. How can I include also the...
5 Jan 2021 by Jeegen Prajapati
I have exported insert query (export.sql). when I run this .sql file via cmd(sqlplus) its show me error like SP2-0027: Input is too long (> 2499 characters) . What I have tried: all the insert query in single line. I have seen somewhere they...
10 Feb 2016 by Jochen Arndt
The system() function already invokes the command processor cmd so that there is no need to execute it again if you not want to let the user enter commands or set specific options.With Windows command prompts, using ';' to separate commands is not supported. Use '&' or '&&' instead where the...
20 Jun 2016 by Jochen Arndt
Qt is a GUI framework. If you don't want a GUI, there is no need to use Qt. Then just use standard C and/or C++ library functions.It is not very clear what you want to achieve. Do you want to open a text file and print the content to the console or process it line by line?That is quite...
17 Oct 2016 by Jochen Arndt
The first thing to do is querying you favorite search machine. Because getting such hardware related information depends on the operating system it should be included in the query. So a query might be "c++ windows list wlan interfaces". Following some hits you should be able to find these...
16 Nov 2016 by Jochen Arndt
Just lookup the documentation for the used utility.If it is from Home of the MD5summer[^] read the notes at Download the MD5summer[^]:Quote:Many people have asked for the md5summer to accept command line parameters, I'm working on it but in the meantime this win32 port of the GNU md5sum...
10 Aug 2017 by Jochen Arndt
There is no meaning because the Windows ping command just ignores any additional characters when the first is a known option. You can check this with options requiring an additional parameter: ping -n 2 dest ping -n1 2 dest Both will perform the same action (send two requests) and ping -n1 dest...
16 Apr 2018 by Jochen Arndt
The line that creates the problem is cmd.append("2>&1"); You forgot to insert a space in front of the output redirection: cmd.append(" 2>&1"); Without the space the last command is echo %username%2 and the output is redirected to stdout. But that does not work because the input is already...
10 Sep 2015 by Kalyan Sundaram
1. Any tool already available to migrate files? 2. its best if there is command line support for thisThanks,Sundar K
18 Aug 2015 by KarstenK
It is often a dll problem. Some missing dlls for your module. Not a release build? Another problem are also rights: the service needs often admin rights to run.Tip: You can debug the service via building it to the install destination and than run it on the debugger.
10 Oct 2016 by KarstenK
You must use the function with the correct parameters.WinExec("c:\\ahul.cmd",SW_SHOWNORMAL);//cut out unneeded stuffNormally you wont store an app in the root of C: but in some ProgramFiles directory.I would recommand that you use the more powerful ShellExecute because it has more...
29 Jun 2020 by kgmmurugesh
Private Sub Form1_Click(sender As Object, e As EventArgs) Handles Me.Click Process.Start("d:\a.bat") End Sub
21 Oct 2014 by kod3brkr
I play Terraria. I host games sometimes. I want users to be able to grab a current map of my world, whenever they want to. So I created a simple web page to use MoreTerra (a mapping software) to create a map in the background for me and a web page to display the map to users.MoreTerra comes...
22 Oct 2014 by kod3brkr
It was suggested to just use the batch file in a Scheduled Task and have the website show the generated image rather than risk the process spam of multiple users clicking the refresh button on the website, in another forum that I also asked this question in. Problem solved. I added a variable...
19 Apr 2015 by Kornfeld Eliyahu Peter
You can not...NET TIME used to synchronize your computer's clock with a time server (without additional parameters it will be the DC), that synchronization done on the binary level, but you have no control over the displayed value...
3 Aug 2020 by l o o l
Something very similar I did some time ago, below is an adaptation / merging with your code and also using for... this is string %errorlevel% == 1 and this is int comparation %errorlevel% EQU 1 @echo off && setlocal enabledelayedexpansion...
3 Aug 2020 by l o o l
Use dir with several files/extensions: dir "C:\Folder-A\File-1.txt" "D:\Folder-B\File-2.log" ... Also use for loop to gets all the logical drivers on your system, try: rem :: In command Line : for /F %i in ('wmic logicaldisk get...
2 Jan 2022 by l o o l
Use double quotes in if "string" == "" () else () Not if string == "", or if defined var () else () Use double quotes in set "var=string" At the end of each label, if you don't want the processing to proceed to the next one, use Goto: EoF You...
15 May 2021 by l o o l
Just try using a loop in /Recursive /Directories: FOR /R - Loop through files (recursively) FOR /D - Loop through several folders/directories For /R "Drive:\Path\To\Origem\Folder" /D And use %~Full Path To Target Folder: copy...
22 May 2021 by l o o l
If you need input interaction in your bat file, use: ���Set /p "variable_name=some string in screen: " @echo off setlocal cd /d "C:\Program Files (x86)\Program Name\Bin\" :loop cls & echo\ set "program=" & set "next=" & ( set /p...
9 Feb 2022 by l o o l
This is an example using a hybrid file.bat + script.r @;echo off && setlocal @; @;pushd "C:\Program Files\R\R-4.0.5\bin\i386\." 2>nul && ( @; @; %__APPDIR__%findstr.exe /vb @; ^"%temp%\RScr.r" @; R.exe --vanilla...
25 Mar 2023 by l o o l
Understand that this is true said by Dave-Kreskowiak You cannot export a single value. You would have to write your own tool to do that A bat would do that, but use a filter and a temp file: @echo off set "_hkey=HKLM\SOFTWARE\Dinesh" >nul reg...