Sign in to follow this  
Followers 0

Run CMD with a Command?

4 posts in this topic

Posted

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

Share this post


Link to post
Share on other sites

Posted

what is the command?

just create a batch file

so create a file called myfile.bat

and in there put your command

Share this post


Link to post
Share on other sites

Posted

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"

Share this post


Link to post
Share on other sites

Posted

Hmm, the shortcut I have already has a /k:
[code]C:\Windows\System32\cmd.exe /k NAMEOFPROG.cmd --search dontshowanymatches && NAMEOFPROG.cmd --help[/code]

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:

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.