Jump to content

Batch command question


Recommended Posts

Im sorry if this was asked any where else all i keep getting anywhere near it is this topic List of default variables + batch file help. i wanted to know like %SYSTEMDRIVE% is there a way to find where your program file dir is, so you dont have to declare \program files\ you just plug in a variable like %programefiles% ? I thought I seen something like this in the unattended guide, but i cant seem to find it.

Link to comment
Share on other sites


I'm not sure I understand your question, but %ProgramFiles% is a default

variable which expands to your Program Files directory. Just type set

in a command window to see all the variables. If that's not what you

wanted, please try to explain more.

Link to comment
Share on other sites

Im sorry if this was asked any where else all i keep getting anywhere near it is this topic List of default variables + batch file help. i wanted to know like %SYSTEMDRIVE% is there a way to find where your program file dir is, so you dont have to declare \program files\  you just plug in a variable like %programefiles% ?  I thought I seen something like this  in the unattended guide, but i cant seem to find it.

Try taking the first "e" out of "%programEfiles%" ;)

Link to comment
Share on other sites

Just a hint, when using the %ProgramFiles% variable, you will most likely need to use quotes around it.

"%ProgramFiles%\MyProgram\program.exe" /command

xcopy C:\moo\ "%ProgramFiles%\stuff"

Those are some examples. Now some things commands need the quotes, while others don't. This is a good reason to test out the commands first.

Link to comment
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...