Click here to Skip to main content
15,881,248 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 Score

Cmd 

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 Aug 2019 by OriginalGriff
Try this: DirectoryInfo di = new DirectoryInfo(@"D:\Test Data"); FileInfo[] info = di.GetFiles(); Dictionary> byType = info.GroupBy(i => i.Extension).ToDictionary(g => g.Key, g => g.ToList());
16 Jun 2020 by Richard Deeming
robocopy | Microsoft Docs[^] There is no support for wildcards in the source directory. You'll need to use a for loop to issue a separate robocopy command for each matching folder. FOR /D %G In ("\\networksourcepath\path\19*") DO robocopy %G...
16 Jun 2020 by Richard MacCutchan
You need to use the set and for commands to get and parse the values. The following example merely echoes them back to the console, but should give you the idea. set /P choice=What are your choices? echo %choices% for %%i in (%choices%) do echo...
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...
24 Feb 2015 by Maciej Los
Please, read my comment to the question.As per i understand you're trying to run batch file from SQL Job Agent to zip files and put it an archive file onto ftp server.. Please, follow below links:How to: Create a CmdExec Job Step (SQL Server Management Studio)How to run multiple...
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...
29 Apr 2018 by OriginalGriff
Um. Think about what you are trying to do: you are trying to get the IP address of a computer via your network, which means you need the IP address in order to talk to it... This may help: Retrieving IP and MAC addresses for a LAN[^] - it's in C#, but online convertes can sort that for you (or...
27 Jan 2019 by Ravi Bhavnani
To disable access to CMD.EXE (and in general control what a user can and cannot do), you should instead use the Group Policy Editor[^]. /ravi
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...
21 Jul 2015 by Sreejesh T J Nair
try this oneexp user/pass@xe FILE=@"D:\new folder\xe.dmp"
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...
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...
28 May 2016 by Patrice T
Your question is just abuse. From the question, one can see you have not even Googled.Your main effort is asking the question.At least use Google or Bing and if the first try don't work, try to formulate the request differently a couple times.
28 May 2016 by PIEBALDconsult
Getting the answer yourself is a lot easier than posting a question here:f:\>help copyCopies one or more files to another location.COPY [/D] [/V] [/N] [/Y | /-Y] [/Z] [/L] [/A | /B ] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination [/A | /B]] source ...
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
1 Jun 2017 by Leo Chapiro
WScript.exe is not a compiler but an interpreter because VBScript is not a compiled programming language but a script language. This interpreter expects as the first parameter the path to script and will interpret it. You can add further parameters like this: wcscript.exe test.vbs "C:\temp\" ...
10 Aug 2017 by OriginalGriff
The ping command is a pretty thick one, they didn't put a lot of work into its parameter parsing. If you look at the command line argument list: Ping Command (Examples, Options, Switches, and More)[^] you will notice they are all single character switches: "-x" where "x" is a single character....
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...
7 Sep 2017 by Hackoo
Check this answer here on stackoverflow batch file - Close All Program Except these with CMD - Stack Overflow[^]
1 Apr 2018 by Member 13757541
I've been having a problem with installing packages in PyCharm. This started happening a few months ago, but before that it was fine. I can install it from the cmd using pip, but when I try to import it into the IDE it gives this error: ModuleNotFoundError: No module named '_winreg' and...
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...
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...
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 =...
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...
16 Aug 2018 by Member 13948830
This is what I did to finally get it to work var processStartInfo = new ProcessStartInfo(@"C:\FFmpeg\bin\ffmpeg.exe"); processStartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; ...
14 Nov 2018 by Richard MacCutchan
I just typed "help prompt" at the console and it shows that $_ is interpreted as CRLF.
10 Jan 2019 by MadMyche
Quote: remote: -----> Python app detected remote: ! Requested runtime (python-3.7) is not available for this stack (heroku-18). remote: ! Aborting. More info: https://devcenter.heroku.com/articles/python-support The messages explain it all; the version of Python you requested (3.7) is not...
28 Jan 2019 by Richard Deeming
If you control the PC, then the simplest option would probably be to use the Image File Execution Options registry key: An Introduction to Image File Execution Options - Malwarebytes Labs | Malwarebytes Labs[^] registry - Set "Image File Execution Options" will always open the named exe file as...
3 Aug 2020 by Member 12899279
for eg i have a system how to find all the fixed drives first then iterate them one by one recursively i.e search all folders and subfolders for specific extensions like .mp3,.mp4,.wav etc with below command i can search in onl one drive that too...
28 Apr 2020 by OriginalGriff
Quote: for an example of what I'm trying to do, is I select one of the commands, for example, "py project -l query" and it runs it through Cmd.exe. When I click the run command button it only runs the first two parts of the command "py...
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...
30 Jun 2021 by Richard MacCutchan
Adding keys to the registry can make your system unusable, especially when not using the proper API calls. You should use Registry Functions - Win32 apps | Microsoft Docs[^], and only ever add to a keyname that you create inside HKEY_CURRENT_USER.
25 Apr 2022 by OriginalGriff
It's the "^" character, but it must be the last character on the line: it can't be followed by a space or anything else. Try it: WINKEY+R, "cmd" ENTER "cd^" It will respond "More?" "\" ENTER The current directory will chance to root. Yes, it...
3 Mar 2023 by Richard MacCutchan
PowerShell is fun :) Export registry information using PowerShell[^] Batch Script - Reading from the Registry[^]
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...
27 Jan 2024 by OriginalGriff
You can't send a key to the app after you start it from the command line: the execution of your commands (or batch file) doesn't happen until the app you ran is closed. However you may be able to use pipelining to send a key to the app: about...
28 Jan 2024 by PIEBALDconsult
As Griff said, if you wrote the console application, then your best choice is to alter it so that it doesn't prompt for input. If it is not something you can change, then maybe it already has something like that. You should investigate it...
19 Aug 2023 by Patrice T
Quote: Recover deleted files I know it is old fashioned, but it looks like you just discovered the reason why serious programmers are keeping loosing their time doing useless backups. The reason is that: Backups are a wast of time and resources...
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...
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?
29 Jul 2014 by Xiao Ling
You can read the SQLite Java Tutorial[^]
3 Aug 2014 by PIEBALDconsult
If TextBox1 contains the command to execute, why not simply pass it as StartInfo.Arguments?http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.arguments(v=vs.110).aspx[^]Have a look at this; there might be something useful in...
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...
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...
30 Oct 2014 by vJay Yadav
view this link for reference Easily-zip-unzip-files
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...
29 Sep 2021 by rnvc
Hi All,Please help anyone how to connect to unix server and run the job in command prompt.ex: cron jobsfunctionality is , when i run a specific job in unix server then few files will move from one location to another location and then i can see data updates in my...
30 Oct 2014 by rnvc
Hi All,Please share if you have any idea to compare two csv files using vbscript or sql.basically we are using qtp ,need to do comparison of two csv files.so am looking to compare fastest way to compare and providing the report.Adding more information,i need to compare based on...
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...
13 Nov 2014 by Member 11118232
i created wifi hotspot with netsh wlan command but it created only adhoc network and ad hoc connection is not visible to my smart phone.is there any way by which i can create a wifi connection which is visible to my smart phone
13 Nov 2014 by Mehdi Gholam
Try this : https://virtualrouter.codeplex.com/[^]
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
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...
24 Feb 2015 by Sander Rossel
I'm having a little problem executing a batch file in SQL Server 2008.I've created a job and I want to zip a file using 7zip and then move that zip to an FTP server. I have a batch file to do this for me, but I want to run it in a job.So first I create a job and then I create a step. The...
25 Feb 2015 by Abdulnazark
do zip by sql agent job onlysee link:http://searchsqlserver.techtarget.com/tip/ZIP-files-with-a-stored-procedure
25 Feb 2015 by Sander Rossel
I've gone around the problem by creating a cmd file and calling it from my job like: "MyFile.cmd".I've added some parameters too: "MyFile.cmd param1 param2"...Not quite what I had in mind, but works like a charm nonetheless.
2 Mar 2015 by Member 11466475
I Want to convert pdf file into text usinf cmd with different cmd.Please help me?e.g.-f number Specifies the first page to convert. -l number Specifies the last page to
24 Mar 2015 by Member 11466475
I Want convert pdf file into text using command Line tool.How it can possible?
24 Mar 2015 by super
Well I am not sure if you are asking for a free tool or not?Anway check this link for command line[^]
1 Apr 2015 by Member 11574780
I'm doing this: net stop wuauservthen:rename c:\windows\SoftwareDistribution SoftwareDistribution.oldand then: mklink E:\windows\SoftwareDistribution \DI'm doing `\d` in the end because otherwise it doesn't work and \d because of the same reason.and then: ...
8 Apr 2015 by Sergey Alexandrovich Kryukov
For example,set tool=%windir%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe%tool% MySolution.sln /p:Configuration=Debug%tool% MySolution.2010.sln /p:Configuration=Release—SA
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...
15 Apr 2015 by Abhinav S
Try string output = p.StandardOutput.ReadToEnd() + " " + DateTime.Now.MilliSeconds;
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 phil.o
echo time does not return the actual date & time, it returns timeecho %time% returns the actual time of the local PC.net time returns the local time of the synchronization server configured for the PC, if any; it returns an error if no synchronization server is configured.
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...
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...
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....
10 Jun 2015 by PIEBALDconsult
The following should give you the path %~dp0And to see more things you can do, use help call
10 Jun 2015 by Richard MacCutchan
Type taskkill /? in a command window to see how to do it.
21 Jul 2015 by M. Daban
Hii want to backup oracle database using my codethis is an command prompt statementexp user/pass@xe FILE="D:\folder\xe.dmp"its work, but if the backup path contains a space like this exp user/pass@xe FILE="D:\new folder\xe.dmp"this command will do the backup but with warnings and i...
21 Jul 2015 by M. Daban
must use a single quotes for the path (thanks for Wes Aday for the hint) exp user/pass@xe FILE='D:\new folder\xe.dmp'
18 Aug 2015 by Somesh Dhal
I have a RPC server & client written in c++. I have .exe for both of them. When i tried to create a service from those exe(using sc create) the service is getting created but its not starting. It shows the error message -"The service did not respond to the start or control request in a timely...
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.
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...
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
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
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
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...
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...
11 Oct 2015 by Sergiu Petrica
What I intend to do is build an application which, among other things, will have a command line embedded in it just like some IDEs do (something I find extremely useful). This is the code that I have so far, do note that it's a Winforms project: public partial class Form1 : Form ...
23 Dec 2015 by Sergey Alexandrovich Kryukov
The worst thing you are doing is using CMD.EXE. I don't know why so many people makes this mistake, suppose this is a diversion of "user thinking" (non-engineering). You absolutely don't need it.Say, you have "textextract.exe". Remove "texteatract" from p.StartInfo.Arguments. Make sure the...
19 Jan 2016 by Mangesh9692
My code isPlease correct that echo Offsetlocal ENABLEEXTENSIONSset KEY_NAME="HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MA Service"set VALUE_NAME=DBServer REG QUERY %KEY_NAME% /S /v %VALUE_NAME%endlocalThis works fine But i want to assign value DBServer to...
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[^]
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...
13 Feb 2016 by Luiey Ichigo
I have try Nijboer link and search a little more about it. And this is what I found:-Private Sub Application_Startup(ByVal sender As Object, ByVal e As System.Windows.StartupEventArgs) Handles Me.Startup Try If e.Args.Length 0 Then Me.StartupUri = New...
28 Feb 2016 by Member 10525430
Hii use cmd code for my device however i dont what to seen the cmd(console window) on the screen my cmd code is:powershell.exe -NonInteractive -WindowStyle Hidden -NoProfile (New-Object Media.SoundPlayer "C:\alarm05.wav").PlaySync()&however its seen 1 sec the hide.Does it possible to...
3 Apr 2016 by Megamanx2012
Hi, I know how to start hosted wlan,but i have x2 wlan card (Intel internal and Alfa USB).Can start x2 hosted wlan (ssid1 on internal and ssid2 on USB ?Can start one only on USB without disable internal wlan ? (because it start by default on first wlan card)CMD and C# code for...
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...
16 Jun 2016 by Member 12573208
When I try to run the sql script for encryption, it takes too long to execute the script and I am forced to cancel the query.However, other gpg commands like list--keys, --import-keys work perfectly. Here is my script:select @encrypt = '"c:\Program Files (x86)\GNU\GnuPG\gpg2.exe" -e -r...
17 Jun 2016 by Strikerzz Arut
Opening an excel sheet using StartInfo is not working.What I have tried:I tried impersonating using the impersonation class, it is not working. Then I passed my user credential using Process.StartInfo.UserName and Process.StartInfo.Password, it is not working. I am opening a CMD prompt...
17 Jun 2016 by Strikerzz Arut
Process.StartInfo.LoadUserProf...
20 Jun 2016 by Member 12587659
I am working on Non Gui Application. I need to browse a datalog file (datalog.txt) from comand line. How I can browse file(datalog.txt) from computer drive without Gui?? I am using QT.What I have tried:I dont have any idea of command line. so any help would be appreciated