CMD SBot Update

06/10/2010 06:42 lbrtdy#1
This is a batch script created for those who do not trust auto update programs or want to feel like they are in control lol. Save this to a file with .bat extension and then drag the .zip file on top and hit any key to continue.

Function:
-Extract .zip file to temp
-Auto update SBot folders
-Exclude Scripts folder
-Delete old SBot.exe
-Delete extracted temp and .zip file

Requirements:
7 zip installed, or another type of extracting program, if another type you may need to look up cmd arguments :p

Note: You may/need to modify the stuff I put in red.

Code:
@echo off
echo Are you sure you want to extract and copy to SBot folders and delete old SBot.exe?
pause

rem ----------- SBot Folders -----------
set folder1="[COLOR="Red"]Path to folder 1[/COLOR]"
set folder2="[COLOR="Red"]Path to folder 2[/COLOR]"
set folder3="[COLOR="Red"]Path to folder 3[/COLOR]"


rem -------------Extract----------------
cd [COLOR="Red"]c:\program files\7-zip[/COLOR]
7z x -o%temp%\temp %1 -xr!Scripts -y
set extracted=%temp%\temp


rem ------------Copy--------------------
echo Deleting old SBot.exe...
cd %folder1%
Del SBot*.exe
echo Copying New files...
xcopy %extracted% %folder1% /V /Y /E /EXCLUDE:c:\excludelist.txt


echo Deleting old SBot.exe...
cd %folder2%
Del SBot*.exe
echo Copying New files...
xcopy %extracted% %folder2% /V /Y /E /EXCLUDE:c:\excludelist.txt


echo Deleting old SBot.exe...
cd %folder3%
Del SBot*.exe
echo Copying New files...
xcopy %extracted% %folder3% /V /Y /E /EXCLUDE:c:\excludelist.txt



rem -------- Delete Temp/Left over files --------
echo deleting temp files . . .
rd /s /q %extracted%
echo deleting original zip file . . .
del %1
echo finished
Add more set folders as needed, make sure the name isn't duplicated, then add one chunk of code under the 'copy' section, be sure to change %folder#% to match the one you put for set
06/10/2010 07:15 theoneofgod#2
#Approved
06/10/2010 19:29 EckoUnltd88#3
nice batch script, i wish u can add to autodownload the new files too ;)