Run CMD with a Command?


Recommended Posts

Hi

I've had a lok on the internet and been unable to find the simple answer to this.

How can I create a shortcut to CMD which when opened will run a command? Obviously I know how to create shortcuts, but getting it to run a command when I've opened it is the problem.

Thanks

Link to comment
Share on other sites

what is the command?

just create a batch file

so create a file called myfile.bat

and in there put your command

Link to comment
Share on other sites

Make a shortcut to cmd.exe and then add /k followed by your command in quotes.

For example to have it open in your Windows directory use the following shortcut:

cmd.exe /k "cd /d c:\windows"

Link to comment
Share on other sites

Hmm, the shortcut I have already has a /k:

C:\Windows\System32\cmd.exe /k NAMEOFPROG.cmd --search dontshowanymatches && NAMEOFPROG.cmd --help

However the command line seems to be playing ball at the moment so I can just hit up to change the command to what I need. I can't really explain fully the program or command line as I suspect it is a grey area, although not illegal.

I wouldn't know how to merge the above in a batch file though. The command I need to run is similar to:

NAMEOFPROG --get XXX --output /Folder --TESTmode=flashhd,flashvhigh

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.