1.

Solve : batch file not running all commands?

Answer»

I'm trying to run several COMMANDS in a batch file. However, the first command brings up a new instance of cmd.exe in the same window (fine), then stops there and doesn't run the other commands in the batch file. Is this not possible?

Here is the first command...

cmd /v

I need to enable delayed environment variable expansion before running the next few commands (cmd /v). I can run all the commands successfully through a cmd.exe window by entering them myself, but I need to schedule this batch file to run at a specific time.

Thanks in advance for any ideas.
SloopyTo enable delayed variable expansion in a batch file, you can PLACE this line before the applicable section of code

Code: [Select]setlocal enabledelayedexpansion
Have you tried that?



Quote from: Dias de verano on OCTOBER 12, 2008, 03:17:50 AM

To enable delayed variable expansion in a batch file, you can place this line before the applicable section of code

Code: [Select]setlocal enabledelayedexpansion
Have you tried that?


Thanks for the reply.

Yes, I tried it and the code runs as if enable delayed expansion is not set to 'on'. I tested by OPENING up a cmd window manually and entering the code with the original (cmd /v) line and it works. Then I re-ran the code with the suggested line and noted the results. Then I re-ran it for a third time without either line and I get the same result as if I ran it by setting the value locally(setlocal enabledelayedexpansion).

If I use 'cmd /v', is there a way that I can force the next line of code to run instead of having to enter it myself?

Sloopy


Hmmmm... without actually seeing the code in question, this becomes a bit of a guessing game.
Quote from: Dias de verano on October 12, 2008, 11:39:18 AM
Hmmmm... without actually seeing the code in question, this becomes a bit of a guessing game.


The code calls another program and unfortunately, that is where the problem occurs. I guess for some reason it only works with 'cmd /v' and not 'setlocal enabledelayedexpansion'. I don't have access to the code for the other program, so I'll have to do some more digging to find a work around.

Thanks for your help,
SloopyHi I also got this same problem with me but still i did'nt get any solution of this please SUGGEST me about this.
_______________________________________ ___________
Capture One Auto Transport


Discussion

No Comment Found