Linked Questions
66 questions linked to/from How can I pass arguments to a batch file?
3
votes
1
answer
9k
views
how to pass arguments to a batch file [duplicate]
I have a batch file to unzip a file, the path of the zip file and destination folder is hardcoded. I want to unzip different zip files to different folders. I don't want to edit the code all the time, ...
-4
votes
1
answer
3k
views
running console application from batch file with command line arguments, How to pass arguments value at run time? [duplicate]
I have a VB.net console application with command line arguments.
Like ("-Arg1=Value1 -Arg2=Value2 -Arg3="Value 3")
this i'm passing arguments from project properties -> Debug ->Command line arguments.
...
4
votes
2
answers
571
views
How to create cmd file for Java program with dependencies [duplicate]
My java program works fine with cmd.
It takes 5arguments and also has external library.
So I am running it from cmd like
java -cp .;jxl.jar MyProgram d: abc 1 d://sv 0
I would like to develop .cmd ...
1
vote
1
answer
675
views
Create cmd command with parameters in batch [duplicate]
I want to create a cmd command by writing a batchfile and put it into "system32" to call it in the cmd console by its name. Is there a way to expect parameters in the batch file:
Write in cmd:
fake-...
0
votes
1
answer
689
views
CMD: How to check if one or more parameters are given [duplicate]
I need to check if one or two parameters are given by the user. Depending on that, different functions will apply.
How can i use anything like OR or AND in this case?
@echo off
:BEGIN
...
1
vote
1
answer
311
views
How to run cmd's goto command (or other) with bat-file from vbscript? [duplicate]
I would like to run file.bat with parameters through a vbscript like this:
Function RunMove()
wshShell.Run("file.bat goto X")
End Function
-2
votes
1
answer
187
views
read batch parameters with single and double - [duplicate]
my batch file is ProcessMe.bat
the Command is this
ProcessMe -color blue -type high --size large --tag gift
the parameters order is not fixed
ProcessMe -type high --tag gift -...
-2
votes
1
answer
164
views
How can I get a string that is next to another string? [duplicate]
I am creating a batch program, and you need to pass arguments to it.
Though with my current code you have to pass the arguments in a certain way.
The way I could fix this is by getting a line of text ...
268
votes
25
answers
405k
views
"Register" an .exe so you can run it from any command line in Windows
How can you make a .exe file accessible from any location in the Windows command window? Is there some registry entry that has to be entered?
445
votes
9
answers
505k
views
How to get the path of the batch script in Windows?
I know that %0 contains the full path of the batch script, e.g. c:\path\to\my\file\abc.bat
I want path to be equal to c:\path\to\my\file.
How can I achieve that?
220
votes
6
answers
620k
views
Using parameters in batch files at Windows command line
In Windows, how do you access arguments passed when a batch file is run?
For example, let's say I have a program named hello.bat. When I enter hello -a at a Windows command line, how do I let my ...
133
votes
14
answers
73k
views
Single script to run in both Windows batch and Linux Bash?
Is it possible to write a single script file which executes in both Windows (treated as .bat) and Linux (via Bash)?
I know the basic syntax of both, but didn't figure out. It could probably exploit ...
142
votes
3
answers
98k
views
What is the at sign (@) in a batch file and what does it do?
One remotely familiar with windows/dos batch scripting will recognize this line:
@echo off
For many-many days, I was happy with the sentiment that the @ is how echo off is meant to be written at the ...
133
votes
1
answer
67k
views
Redirecting passed arguments to a windows batch file [duplicate]
I would like to call a jar file from a windows batch file. One requirement is to be able to pass all the batch file arguments as-is to the jar file invocation. For example,
Required Command line:
...
50
votes
8
answers
39k
views
Is there a way to indicate the last n parameters in a batch file?
In the following example, I want to call a child batch file from a parent batch file and pass all of the remaining parameters to the child.
C:\> parent.cmd child1 foo bar
C:\> parent.cmd child2 ...