Hello,
I am not exaclty sure if this is the right place to be posting this but it may be considered OS b/c it is windows specific?
Anyways here is the situation. I would like to run a .bat file to run a program through the command line. Here is the code I would like to run from the cmd.
Since it is in a .bat I can copy the bat file to the directory and then run the .bat
Here is the problem, when I run it in a .bat it just shows up and disappears. (it doesnt even look like it gets past the command) but the cmd needs to stay open to run the command.
I have tried "pause" and I have also tried to run a "cmd /k" as:
and
and finally:
None of which worked.
I then tried to run a pause after an echo after the last command ^
Here is exactly what the .bat says:
And here is the output.
It seems as though the bat isnt importing the exact line into the cmd window. Any Ideas?
I am not exaclty sure if this is the right place to be posting this but it may be considered OS b/c it is windows specific?
Anyways here is the situation. I would like to run a .bat file to run a program through the command line. Here is the code I would like to run from the cmd.
Code:
for /R %i IN (.) do "C:\Program Files\WinRAR\Rar.exe" x "%i/*.rar"
Since it is in a .bat I can copy the bat file to the directory and then run the .bat
Here is the problem, when I run it in a .bat it just shows up and disappears. (it doesnt even look like it gets past the command) but the cmd needs to stay open to run the command.
I have tried "pause" and I have also tried to run a "cmd /k" as:
Code:
cmd /k
for /R %i IN (.) do "C:\Program Files\WinRAR\Rar.exe" x "%i/*.rar"
Code:
for /R %i IN (.) do "C:\Program Files\WinRAR\Rar.exe" x "%i/*.rar"
cmd /k
and finally:
Code:
cmd /k for /R %i IN (.) do "C:\Program Files\WinRAR\Rar.exe" x "%i/*.rar"
None of which worked.
I then tried to run a pause after an echo after the last command ^
Here is exactly what the .bat says:
Code:
cmd /k for /R %i IN (.) do "C:\Program Files\WinRAR\Rar.exe" x "%i/*.rar"
echo test
pause
Code:
C:\Users\Toshiba\Desktop\testing>cmd /k for /R[COLOR="Lime"] \Program Files\WinRAR\Rar.exe" x
"i/*.rar"[/COLOR]
[COLOR="Lime"]Files\WinRAR\Rar.exe" x "i/*.rar" was unexpected at this time.[/COLOR]
C:\Users\Toshiba\Desktop\testing>echo test
test
C:\Users\Toshiba\Desktop\testing>pause
Press any key to continue . . .
It seems as though the bat isnt importing the exact line into the cmd window. Any Ideas?