Jump to content

(SOLVED) Need Help Creating A Batch File


cworkman

Recommended Posts

Hi Im Tryin To Create A Batch File For A Program and i need help!

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 when i click on the install.bat the command prompt window pops up but close's

what am i doin wrong?

Edited by cworkman
Link to comment
Share on other sites

Hi Im Tryin To Create A Batch File For A Program and i need help!

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 when i click on the install.bat the command prompt window pops up but close's

what am i doin wrong?

You can see where you did wrong by opening command prompt window and dragging this script inside the window+enter to run it. Then your window will stay opened and you would be able to see which command you did wrong.

Link to comment
Share on other sites

it Works Fine If I Do It Like That it Just Won't Let My Execute the code from install.bat

I asked my colleague now and he says that you should define the "start in" folder to run the script. That could be the problem, but he's not positive.

Link to comment
Share on other sites

I asked my colleague now and he says that you should define the "start in" folder to run the script. That could be the problem, but he's not positive.

ok first of all i change the code

@ECHO OFF

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

ECHO.

ECHO STEP 1: In The Window That Pops Up Click Create Windows XP CD Images

ECHO.

ECHO STEP 2: Click Create Windows XP Professional CD Image

ECHO.

ECHO STEP 3: Click Windows XP Professional Corporate CD IMage

ECHO.

ECHO STEP 4: Click Exit

ECHO.

pause

ECHO.

C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1

ECHO.

ECHO Copying New ISO To Working Area

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

ECHO.

ECHO Deleting New ISO From TEMP Storage

DEL "C:\VRMPVOL_EN.ISO"

pause

ECHO.

ECHO Mounting Windows XP Professional Corp ISO;

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

pause

set w=s

ECHO.

ECHO Copying Searching For XP Pro Crop Setup Files

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

ECHO.

pause

ECHO.

ECHO Copying XP Pro Crop Setup Files To C:\WinXP\XPCD

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

pause

ECHO.

C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1

2nd i used quick batch file compiler and it seems to screw up on Line Of

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

so why is it workin when i copy and paste it into the command prompt window but not when i use the install.bat

Link to comment
Share on other sites

ok i got it working

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

Should Be

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

When Executing it in a batch file!

Link to comment
Share on other sites

Well, you haven't really explained what you want to do. I assume you want to mount an ISO (with multiple ISO files), then copy an ISO to C:\, then mount it, then copy the contents of that ISO to C:\WinXP\XPCD

Am I right?

First, you haven't declared your mount-point.

See: http://www.magiciso.com/tutorials/miso-mount-iso-image.htm

miso.exe NULL -mnt j: "c:\backup\1.uif"

mount "c:\backup\1.uif" to virtual drive j:

Please notes: miso.exe ignores the "NULL" parameters.

Change drive 'X:' to whatever UNUSED drive letter you want (Never use A, B, or C).

@echo off

IF not EXIST "C:\WinXP\XPCDTOOLS\miso.exe" GOTO error
IF not EXIST "C:\WinXP\WinXP9-in-1.iso" GOTO error
echo Mounting ISO to drive X
C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt X: "C:\WinXP\WinXP9-in-1.iso"
echo Copying source ISO
COPY "X:\VRMPVOL_EN.ISO" "C:\WinXP\ISO\*" /Y /V
C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1
echo Mounting ISO
IF not EXIST "C:\WinXP\ISO\VRMPVOL_EN.ISO" GOTO error
C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt X: "C:\WinXP\ISO\VRMPVOL_EN.ISO"

for %%a in (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 %%a:\WIN51 set ISO=%%a
echo Copying files
XCOPY %ISO%:\* "C:\WinXP\XPCD\*" /Y /H /E
C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1
:END
END

:ERROR
echo Cannot find files
pause
goto end

To see what the code is doing, remove the "@echo off"

*Edit, We cross-posted. Glad to see you got it working. My code adds more failsafes and cleans up after itself (unmounts drives).

Edited by Mr_Smartepants
Link to comment
Share on other sites

Well, you haven't really explained what you want to do. I assume you want to mount an ISO (with multiple ISO files), then copy an ISO to C:\, then mount it, then copy the contents of that ISO to C:\WinXP\XPCD

Am I right?

First, you haven't declared your mount-point.

See: http://www.magiciso.com/tutorials/miso-mount-iso-image.htm

Change drive 'X:' to whatever UNUSED drive letter you want (Never use A, B, or C).

@echo off

IF not EXIST "C:\WinXP\XPCDTOOLS\miso.exe" GOTO error
IF not EXIST "C:\WinXP\WinXP9-in-1.iso" GOTO error
echo Mounting ISO to drive X
C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt X: "C:\WinXP\WinXP9-in-1.iso"
echo Copying source ISO
COPY "X:\VRMPVOL_EN.ISO" "C:\WinXP\ISO\*" /Y /V
C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1
echo Mounting ISO
IF not EXIST "C:\WinXP\ISO\VRMPVOL_EN.ISO" GOTO error
C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt X: "C:\WinXP\ISO\VRMPVOL_EN.ISO"

for %%a in (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 %%a:\WIN51 set ISO=%%a
echo Copying files
XCOPY %ISO%:\* "C:\WinXP\XPCD\*" /Y /H /E
C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1
:END
END

:ERROR
echo Cannot find files
pause
goto end

To see what the code is doing, remove the "@echo off"

Well I Downloaded A 9-IN-1 XPCD From A Torrent Site And I Need The XP PRO Version! So I Wanted To Make A Batch File That Would Mount The 9in1 ISO then with CDIMAGE Make An XP PRO ISO! Then Move That ISO To The WinXP Folder Unmount The 9-in-1! Then Mount The XP PRO ISO Copy All Files And Folders To The WinXP\XPCD Unmount The XP PRO ISO That Way I Can Integrate SP3! And Add My Own Genuine Product Key! Yes I Own XP Pro! My CD Broke! To Many Scratch's

C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\WinXP9-in-1.iso" (This Mouts The 9-in-1 ISO To Virtual Drive 1)

C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1 (This Unmounts The 9-in-1 ISO)

COPY C:\VRMPVO~1.ISO "C:\WinXP" /Y /V (Copies XP PRO ISO To C:\WinXP)

DEL "C:\VRMPVOL_EN.ISO" (Deletes The XP PRO ISO From C:\)

C:\WinXP\XPCDTOOLS\miso.exe NULL -mnt 1 "C:\WinXP\VRMPVO~1.ISO" (Mounts The XP PRO ISO)

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:\WIN51IP.SP2 set w=%x (SCANS For Certain Files To Get Drive Leter Of The Virtual Drive)

XCOPY %w%:\ "C:\WinXP\XPCD" /Y /H /E (Copies All Files And Folders To C:\WinXP\XPCD)

C:\WinXP\XPCDTOOLS\miso.exe NULL -umnt 1 (UnMounts XP PRO ISO)

Edited by cworkman
Link to comment
Share on other sites

  • 1 year later...
Guest
This topic is now closed to further replies.
×
×
  • Create New...