the cmd line arguments are available to you in the form %0, %1, %2. With %~d0 in your current code, you are pulling the letter drive from argument %0.
This MS page can probably help you.
Weirdly enough, the link works if I click it, but does not for some users. Here's the path if you'd like to copy paste it in your preferred browser. As you can see in the link, this is pulled from WindowsXP documentation, that may explain why the link is flaky at best.
https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true
EditIt seems like you want to call a program and pass that program a parameter as you are calling it. And you wish to start the program from a bat file. This is different than how I read your title.
Lets start with some basics... For reference sake, we'll say the program I am using today is called GetToWork.exe
The program I am using GetToWork.exe offers me the ability to start it many different ways.
- I can double click the exe which launches the program in a form
- I can call the exe from CMD line and pass it parameters so it can do automated things without me having to do anything.
- I can pass the parameter
--DontAskMeAnything if I want the program to do everything on its own.
- I can pass the parameter
--AskMeForNewFile if I want the program to ask me before doing something to what it will consider to be a new file.
- I can pass it the parameter
--DoItThisWayInstead if I want the parameter to do it a different way.
Now, I'm not the one who decided what parameters I can pass, nor what their result is going to be. In fact, the parameters were defined by the programmer who created the program. When he made the program, he decided that those were going to be the allowed parameters, and the actions related to them were going to be the actions that he decided. The programmer documented the parameters, and now I just want to use them because they make my life easier.
In order to trigger the parameter behaviors, I need to supply the said parameters to the program when I run it.
If I wanted to trigger --DontAskMeAnything I would write this command:
GetToWork.exe --DontAskMeAnything
If I wanted to trigger --AskMeForNewFile, then I would write this command:
GetToWork.exe --AskMeForNewFile
If GetToWork.exe allows multiple parameters, I would maybe write something like this:
GetToWork.exe --AskMeForNewFile --DoItThisWayInstead
Now... back to you and your program. You are using a program called 10th-f-Downsampling.exe. We, I, don't know that program. We, I, don't know what the possible parameters are for that program. In order for you to know what you should pass, you'll have to look up the documentation of that program. Sometimes just calling the exe with a /? is enough to get the parameter list. Again, this is dependant on the programmer who made the program as /? would simply be another parameter allowed by the programmer. And the result of the /? is usually to spit out the available parameters...
Lets break down your current code
xcopy %~d0\dir-files\record\*.* "%~dp0input" /Y
- Here, the program you are calling is
xcopy
- The first parameter you are passing to xcopy is
%~d0\dir-files\record\*.*
- The second parameter you are passing is
"%~dp0input"
- The third parameter you are passing is
/Y
If you were to go into command prompt and run this command xcopy /?, you'd get a chunk of text showing you how to call the program, along with a list of parameters that can be passed. Although parameters are often recognized by name... their name has little meaning because once in the program, the programmer may have coded it so that only parameter position matters, or position and name, or whatever other cocktail of business rules he obliged by. Though it's important to follow the directions if directions are provided in the documentation.
%0,%1,%2. With%~d0in your current code, you are pulling theletter drivefrom argument%0- blaze_12510th-f-Downsampling.exe start /wait max_old_space_size=3000, so perhaps you are confused in your description of what you want... - Aacinimax_old_space_size=3000value to it; I just noted what a command line argument is. Don't you have the user's manual of your program? - Aacini