Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Variables in batch files
Name: sankar Date: December 6, 2002 at 02:43:18 Pacific OS: drdos CPU/Ram: p4 - 128
Comment:
sir how i can use variables in batch files
i need to receive return values from c -exe files to batch file variables and i want to check the values in the batch files
Name: dtech10 Date: January 21, 2003 at 14:56:08 Pacific
Reply:
Hi Sankar If have you written the C programs yourself, if so your could output as many variables as you like, using the code below. If youre not sure how it works send me a email.
[BatchFile.bat] @echo off if not (%1)==() goto Var echo @echo off >tmp.bat CProgram.exe >> tmp.bat tmp.bat :Var set XVar=%1; del tmp.bat [End BatchFile.bat]
0
Response Number 2
Name: dtech10 Date: January 22, 2003 at 14:19:36 Pacific
Reply:
Hi Sankar I've found a better way way to recieve return values from your c programs. I've just echoed the values to the sceeen just so that you can test it's working ok.
@echo off c-Prog1.exe rem Note errorlevel only supports 1 byte rem values from 0 to 255 rem errorlevel=12 if errorlevel 12;if not errorlevel 13 echo %errorlevel% c-Program2.exe rem errorlevel=5 if errorlelel 5;if not errorlevel 6 echo %errorlevel% ect.
Summary: I am trying to figure out how to program variables in batch files. Any help on the following script would be helpful. Thanks!! :test net send * Hello set %A%=0 set %B%=%A%+1 If %B%= 50 GOTO 2 Else Got...
Summary: What does the percent sing mean in batch files. i am really confused about that. it seems like i ve seen it used in different ways. Does it set declare variable or what? thank you. using dos 6.22...
Summary: Ok, I am making a batch file that basically has only one purpose. It does the command "net use" and it connects J drive to one of my network drives. The problem is, net use seems to be different for...