Jump to content

Batch Help


RandomClown

Recommended Posts

====================

INTRODUCTION:

--------------------

OYFG I thought this would be quick to write, but this one part is impossible to figure out!

I have been looking at this thing for hours!! [yes, really been hours!!]

I reinstall some games in my Orange Box a lot, so instead of redownloading them, I am throwing them on to DVDs.

I RARed the game contents & was making a batch to extract only the games I want to play. Also if my friends wants a copy of the DVDs, then he can also access his/her games too.

[must have a steam account with the games already purchased for the contents to work]

====================

BATCH "Auto-Extract.bat":

--------------------

I am stuck at the "Queue" part.

It will NOT recognize "QueueBatchCall.bat" in my test ISO or my now wasted test DVDs.

[note, if your testing it, you can also throw that file on to any HDD/Thumb-Drive root]

====================

LOCATION OF PROBLEM:

--------------------

Around here & after

set Tag=QueueBatchCall.bat

set Drive=

if exist A:\%Tag% set Drive=A

if "%Drive%" == "A" (

goto QueueBatchCall

...

====================

WHATS WRONG:

--------------------

I think:

set Tag=QueueBatchCall.bat sets %Tag%

if exist R:\%Tag% set Drive=R sees the file

but if exist R:\%Tag% set Drive=R cant find it.

====================

EXTRA INFO:

--------------------

I uploaded the files in a ZIP.

Please help me, someone!

My brain hurts & Im gonna go crazy!

Thanks

PS: If someone was looking for the attachment right after I posted, it wasnt there because vista wouldnt let me upload. It was crashing, so I got on XP to upload.

Link to comment
Share on other sites

I thought I made the next post already!

Nevermind, not allowed.

The archive contents can be replaced with a blank text file for testing.

DVD 1:

RAR.exe

Auto-Extract.bat

Counter-Strike Source.rar

Episode 1-2 Shared.rar

Episodic Shared.rar

Half-Life 2 Deathmatch.rar

Half-Life 2 Episode 1.rar

Half-Life 2 Episode 2.rar

Half-Life 2 Lost Coast.rar

Half-Life 2.rar

DVD 2:

RAR.exe

Auto-Extract.bat

ExtractBatchCall.bat

QueueBatchCall.bat

Garry's Mod.rar

Portal.rar

Source Engine.rar

Source SDK.rar

Team Fortress 2.rar

DVD 1:

Auto-Extract.bat

set Drive=

set BatchCall=1

@echo off

title Auto-Extract Steam Contents

:SetDir

set dir=C:\Program Files\Steam\steamapps

cls

color 0f

echo.

echo.

echo.

echo Type in the directory. Default is %dir%

echo when no directory is chosen.

echo.

echo Note:

echo "Right Click" and click "Paste" to paste a directory you copied,

echo "Ctrl + V" will NOT work.

echo.

echo.

echo.

set /p dir= Directory:

if "%dir%" == "" (

set dir=%userprofile%\Desktop

)

:verify

cls

echo.

echo.

echo.

echo Directory: "%dir%\"

echo.

echo Is that right?

echo.

echo.

echo.

set /p q= Yes or No:

if /i "%q%" == "Yes" (

goto Start

)

if /i "%q%" == "No" (

goto SetDir

)

cls

echo.

echo.

echo.

echo You wrote "%q%"

echo.

echo Answer not understood, make sure you only wrote Yes or No.

echo.

echo.

echo.

pause

goto verify

exit

:Start

set HL20S=

set HL20=

set HL21S=

set HL21=

set HL22S=

set HL22=

set HLDmS=

set HLDm=

set HL2LCS=

set HL2LC=

set CSSS=

set CSS=

set PortalS=

set Portal=

set GModS=

set GMod=

set TF2S=

set TF2=

set SSDKS=

set SSDK=

set SES=

set SE=

set OverWriteS=

set OverWrite=-o-

set QueueS=

set Queue=

:Choose1

cls

echo Disk 1

echo.

echo Type the number or letter to what options you

echo want then press enter, one at a time.

echo.

echo.

echo.

echo %HL20S% 1 = Half-Life 2

echo.

echo %HL21S% 2 = Half-Life 2 Episode 1

echo.

echo %HL22S% 3 = Half-Life 2 Episode 2

echo.

echo %HLDmS% 4 = Half-Life 2 Deathmatch

echo.

echo %HL2LCS% 5 = Half-Life 2 Lost Coast

echo.

echo %CSSS% 6 = Counter-Strike Source

echo.

echo.

echo.

echo %OverWriteS% O = Overwrite Existing Files

echo.

echo %QueueS% Q = Queue Disk 2 to extract immediatly after Disk 1;

if "%Drive%" == "" (

echo Will NOT work with 1 DVD drive

) else (

echo Disk 2 previously found on "%Drive%"

)

echo.

echo OK = Start extracting

echo.

echo All = Select all games shown, 1-6

echo.

echo X = Reset all, including whats in queue

echo.

echo.

echo If you didnt know,

echo SCROLL UP to see the beginning.

echo.

set /p opt= Choose:

if /i "%opt%" == "1" (

set HL20S=X

set HL20=RAR x "Half-Life 2.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "2" (

set HL21S=X

set HL21=RAR x "Half-Life 2 Episode 1.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "3" (

set HL22S=X

set HL22=RAR x "Half-Life 2 Episode 2.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "4" (

set HLDmS=X

set HLDm=RAR x "Half-Life 2 Deathmatch.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "5" (

set HL2LCS=X

set HL2LC=RAR x "Half-Life 2 Lost Coast.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "6" (

set CSSS=X

set CSS=RAR x "Counter-Strike Source.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "OK" (

cls

echo.

echo.

echo.

echo Beginning extraction [if any]...

echo.

echo.

%HL20%

%HL21%

%HL22%

if "%HL21S%" == "X" (

if "%OverWriteS%" == "X" (

del /f /q "%dir%\episode 1 shared.gcf"

set Episode1-2SharedDeleted=X

)

if not exist "%dir%\episode 1 shared.gcf" RAR x "Episode 1-2 Shared.rar" %OverWrite% "%dir%\"

)

if "%HL22S%" == "X" (

if "%OverWriteS%" == "X" (

if "%Episode1-2SharedDeleted%" == "X" (

goto Episode1-2SharedDeletedAlready

)

del /f /q "%dir%\episode 1 shared.gcf"

:Episode1-2SharedDeletedAlready

del /f /q "%dir%\episodic 2007 shared.gcf"

)

if not exist "%dir%\episode 1 shared.gcf" RAR x "Episode 1-2 Shared.rar" %OverWrite% "%dir%\"

if not exist "%dir%\episodic 2007 shared.gcf" RAR x "Episodic Shared.rar" %OverWrite% "%dir%\"

)

%HLDm%

%HL2LC%

%CSS%

%Queue%

echo.

echo.

echo.

if exist "%dir%\base source engine 2.gcf" goto NeedSE

echo Done! You at least need the source engine to play the game.

echo Press any key to exit, then insert the next disk.

echo.

pause > nul

exit

:NeedSE

echo Done! Press any key to exit.

echo.

pause > nul

exit

)

if /i "%opt%" == "All" (

set HL20S=X

set HL20=RAR x "Half-Life 2.rar" %OverWrite% "%dir%\"

set HL21S=X

set HL21=RAR x "Half-Life 2 Episode 1.rar" %OverWrite% "%dir%\"

set HL22S=X

set HL22=RAR x "Half-Life 2 Episode 2.rar" %OverWrite% "%dir%\"

set HLDmS=X

set HLDm=RAR x "Half-Life 2 Deathmatch.rar" %OverWrite% "%dir%\"

set HL2LCS=X

set HL2LC=RAR x "Half-Life 2 Lost Coast.rar" %OverWrite% "%dir%\"

set CSSS=X

set CSS=RAR x "Counter-Strike Source.rar" %OverWrite% "%dir%\"

goto Choose1

)

if /i "%opt%" == "X" (

goto Start

)

if /i "%opt%" == "O" (

set OverWriteS=X

set OverWrite=-o+

goto Choose1

)

if /i "%opt%" == "Q" (

cls

echo.

echo.

echo.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo If you get an error message, click Continue.

echo.

echo.

echo.

set Tag=QueueBatchCall.bat

set Drive=

if exist A:\%Tag% set Drive=A

if "%Drive%" == "A" (

goto QueueBatchCall

)

if exist B:\%Tag% set Drive=B

if "%Drive%" == "B" (

goto QueueBatchCall

)

if exist C:\%Tag% set Drive=C

if "%Drive%" == "C" (

goto QueueBatchCall

)

if exist D:\%Tag% set Drive=D

if "%Drive%" == "D" (

goto QueueBatchCall

)

if exist E:\%Tag% set Drive=E

if "%Drive%" == "E" (

goto QueueBatchCall

)

if exist F:\%Tag% set Drive=F

if "%Drive%" == "F" (

goto QueueBatchCall

)

if exist G:\%Tag% set Drive=G

if "%Drive%" == "G" (

goto QueueBatchCall

)

if exist H:\%Tag% set Drive=H

if "%Drive%" == "H" (

goto QueueBatchCall

)

if exist I:\%Tag% set Drive=I

if "%Drive%" == "I" (

goto QueueBatchCall

)

if exist J:\%Tag% set Drive=J

if "%Drive%" == "J" (

goto QueueBatchCall

)

if exist K:\%Tag% set Drive=K

if "%Drive%" == "K" (

goto QueueBatchCall

)

if exist L:\%Tag% set Drive=L

if "%Drive%" == "L" (

goto QueueBatchCall

)

if exist M:\%Tag% set Drive=M

if "%Drive%" == "M" (

goto QueueBatchCall

)

if exist N:\%Tag% set Drive=N

if "%Drive%" == "N" (

goto QueueBatchCall

)

if exist O:\%Tag% set Drive=O

if "%Drive%" == "O" (

goto QueueBatchCall

)

if exist P:\%Tag% set Drive=P

if "%Drive%" == "P" (

goto QueueBatchCall

)

if exist Q:\%Tag% set Drive=Q

if "%Drive%" == "Q" (

goto QueueBatchCall

)

if exist R:\%Tag% set Drive=R

if "%Drive%" == "R" (

goto QueueBatchCall

)

if exist S:\%Tag% set Drive=S

if "%Drive%" == "S" (

goto QueueBatchCall

)

if exist T:\%Tag% set Drive=T

if "%Drive%" == "T" (

goto QueueBatchCall

)

if exist U:\%Tag% set Drive=U

if "%Drive%" == "U" (

goto QueueBatchCall

)

if exist V:\%Tag% set Drive=V

if "%Drive%" == "V" (

goto QueueBatchCall

)

if exist W:\%Tag% set Drive=W

if "%Drive%" == "W" (

goto QueueBatchCall

)

if exist X:\%Tag% set Drive=X

if "%Drive%" == "X" (

goto QueueBatchCall

)

if exist Y:\%Tag% set Drive=Y

if "%Drive%" == "Y" (

goto QueueBatchCall

)

if exist Z:\%Tag% set Drive=Z

if "%Drive%" == "Z" (

goto QueueBatchCall

)

cls

echo.

echo.

echo.

echo Disk 2 not found. Insert Disk 2 into another drive, DO NOT remove Disk 1.

echo If you do not have another drive, you cant queue Disk 2.

echo.

set Drive=

pause

goto Choose1

:QueueBatchCall

call "%Drive%:\QueueBatchCall.bat"

cls

echo.

echo.

echo.

echo You just exited the queue. The settings remain until you clear them.

echo Press any key to return to the main menu.

echo.

pause > nul

goto Choose1

)

cls

echo.

echo.

echo.

echo Chose: %opt%

echo.

echo.

echo.

echo "%opt%" is not an option.

echo.

echo Check your spelling, did you add space by accident?

echo.

pause

goto Choose1

exit

DVD 2:

Auto-Extract.bat

@echo off

title Auto-Extract Steam Contents

:SetDir

set dir=C:\Program Files\Steam\steamapps

cls

color 0f

echo.

echo.

echo.

echo Type in the directory. Default is %dir%

echo when no directory is chosen.

echo.

echo Note:

echo "Right Click" and click "Paste" to paste a directory you copied,

echo "Ctrl + V" will NOT work.

echo.

echo.

echo.

set /p dir= Directory:

if "%dir%" == "" (

set dir=%userprofile%\Desktop

)

:verify

cls

echo.

echo.

echo.

echo Directory: "%dir%\"

echo.

echo Is that right?

echo.

echo.

echo.

set /p q= Yes or No:

if /i "%q%" == "Yes" (

goto Start

)

if /i "%q%" == "No" (

goto SetDir

)

cls

echo.

echo.

echo.

echo You wrote "%q%"

echo.

echo Answer not understood, make sure you only wrote Yes or No.

echo.

echo.

echo.

pause

goto verify

exit

:Start

set PortalS=

set Portal=

set GModS=

set GMod=

set TF2S=

set TF2=

set SSDKS=

set SSDK=

set SES=

set SE=

set OverWriteS=

set OverWrite=-o-

:Choose

cls

echo Disk 2

echo.

echo Type the number or letter to what options you

echo want then press enter, one at a time.

echo.

echo.

echo.

echo %PortalS% 7 = Portal Scroll Up

echo.

echo %TF2S% 8 = Team Fortress 2

echo.

echo %GModS% 9 = Garry's Mod

echo.

echo %SSDKS% 10 = Source Software Developement Kit

echo.

echo %SES% 11 = Source Engine

echo.

echo.

echo.

echo %OverWriteS% O = Overwrite Existing Files

echo.

echo OK = Start extracting

echo.

echo All = Select all applications shown, 7-11

echo.

echo X = Reset

echo.

echo.

echo.

set /p opt= Choose:

if /i "%opt%" == "7" (

set PortalS=X

set Portal=RAR x "Portal.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "8" (

set TF2S=X

set TF2=RAR x "Team Fortress 2.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "9" (

set GModS=X

set GMod=RAR x "Garry's Mod.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "10" (

set SSDKS=X

set SSDK=RAR x "Source SDK.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "11" (

set SES=X

set SE=RAR x "Source Engine.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "OK" (

cls

echo.

echo.

echo.

echo Beginning extraction [if any]...

echo.

echo.

%Portal%

%TF2%

%GMod%

%SSDK%

%SE%

echo.

echo.

echo.

if exist "%dir%\base source engine 2.gcf" goto NeedSE

echo Done! You at least need the source engine to play the game.

echo You should extract the source engine now. Press any key to exit.

echo.

pause > nul

exit

:NeedSE

echo Done! Press any key to exit.

echo.

pause > nul

exit

)

if /i "%opt%" == "All" (

set PortalS=X

set Portal=RAR x "Portal.rar" %OverWrite% "%dir%\"

set TF2S=X

set TF2=RAR x "Team Fortress 2.rar" %OverWrite% "%dir%\"

set GModS=X

set GMod=RAR x "Garry's Mod.rar" %OverWrite% "%dir%\"

set SSDKS=X

set SSDK=RAR x "Source SDK.rar" %OverWrite% "%dir%\"

set SES=X

set SE=RAR x "Source Engine.rar" %OverWrite% "%dir%\"

goto Choose

)

if /i "%opt%" == "X" (

goto Start

)

if /i "%opt%" == "O" (

set OverWriteS=X

set OverWrite=-o+

goto Choose

)

cls

echo.

echo.

echo.

echo Chose: %opt%

echo.

echo.

echo.

echo "%opt%" is not an option.

echo.

echo Check your spelling, did you add space by accident?

echo.

pause

goto Choose

exit

ExtractBatchCall.bat

if "%BatchCall%" == "1" (

goto Pass

)

exit

:Pass

:Choose2

cls

echo Disk 2

echo.

echo Type the number or letter to what options you

echo want then press enter, one at a time.

echo.

echo.

echo %PortalS% 7 = Portal

echo.

echo %TF2S% 8 = Team Fortress 2

echo.

echo %GModS% 9 = Garry's Mod

echo.

echo %SSDKS% 10 = Source Software Developement Kit

echo.

echo %SES% 11 = Source Engine

echo.

echo.

echo.

echo OK = Go back to the main menu

echo.

echo All = Select all of this queue, 7-11

echo.

echo X = Reset only this queue

echo.

echo.

echo.

set /p opt= Choose:

if /i "%opt%" == "7" (

set PortalS=X

set Portal=RAR x "Portal.rar" "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "8" (

set TF2S=X

set TF2=RAR x "Team Fortress 2.rar" "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "9" (

set GModS=X

set GMod=RAR x "Garry's Mod.rar" "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "10" (

set SSDKS=X

set SSDK=RAR x "Source SDK.rar" "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "11" (

set SES=X

set SE=RAR x "Source Engine.rar" "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "OK" (

exit

)

if /i "%opt%" == "All" (

set PortalS=X

set Portal=RAR x "Portal.rar" %OverWrite% "%dir%\"

set TF2S=X

set TF2=RAR x "Team Fortress 2.rar" %OverWrite% "%dir%\"

set GModS=X

set GMod=RAR x "Garry's Mod.rar" %OverWrite% "%dir%\"

set SSDKS=X

set SSDK=RAR x "Source SDK.rar" %OverWrite% "%dir%\"

set SES=X

set SE=RAR x "Source Engine.rar" %OverWrite% "%dir%\"

set QueueS=X

set Queue=call "%Drive%:\ExtractBatchCall.bat"

goto Choose2

)

if /i "%opt%" == "X" (

set PortalS=

set Portal=

set GModS=

set GMod=

set TF2S=

set TF2=

set SSDKS=

set SSDK=

set SES=

set SE=

set QueueS=

set Queue=

goto Choose2

)

cls

echo.

echo.

echo.

echo Chose: %opt%

echo.

echo.

echo.

echo "%opt%" is not an option.

echo.

echo Check your spelling, did you add space by accident?

echo.

pause

goto Choose2

exit

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...