...

View Full Version : Resolved Batch file help needed



cworkman29729
12-02-2008, 04:58 AM
i have some code for a batch file i and if i open command prompt and past all the lines in it works but if i add the code to a file and click the install.bat it doesn't work

@ECHO OFF
set w=s
for /d %x in ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do if exist %x:\Software\App\Setup.exe
set w=%x
%w%:\Software\App\Setup.exe

How Can I Get That To execute when i double click on the Install.bat

right now the command prompt window just opens and close's

Spookster
12-02-2008, 09:06 AM
If you want to launch that process you need to use the start command. See my thread on writing a batch file to launch a process:
http://www.codingforums.com/showthread.php?t=132824&highlight=batch

cworkman29729
12-02-2008, 09:10 AM
oh i forgot to update the post

i change it to this

set w=s
C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\WinXP9-in-1.iso"

pause

COPY C:\VRMPVO~1.ISO "C:\WinXP" /Y /V
DEL "C:\VRMPVOL_EN.ISO"

C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\VRMPVO~1.ISO"

for /d %x in ( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ) do if exist %x:\WIN51IP.SP2 set w=%x

XCOPY %w%:\ "C:\WinXP\XPCD" /Y /H /E

but its still not working

Roelf
12-02-2008, 11:17 AM
when using the for statement in a batch file, you have to use a double percent sign in the varname:
for /d %%x in .......

cworkman29729
12-02-2008, 11:27 AM
when using the for statement in a batch file, you have to use a double percent sign in the varname:
for /d %%x in .......

Thanks Its Working Now! :thumbsup:

barkermn01
12-02-2008, 04:23 PM
Thanks Its Working Now! :thumbsup:

This is correct but it is better coding to do %x%



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum