Sir Topham Hatt Posted March 11, 2013 Share Posted March 11, 2013 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 More sharing options...
Haggis Veteran Posted March 11, 2013 Veteran Share Posted March 11, 2013 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 More sharing options...
Tomoko Posted March 11, 2013 Share Posted March 11, 2013 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 More sharing options...
Sir Topham Hatt Posted March 11, 2013 Author Share Posted March 11, 2013 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 More sharing options...
Recommended Posts