Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal enabledelayedexpansion
- set "source=C:\Users\---user folder here---\Desktop\AuthHashTool"
- set "target=C:\Users\---user folder here---\Desktop\Games"
- Cd "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"
- echo;
- echo CAUTION^:
- echo;
- echo This script will convert all folders in "Games" which have names with 32 characters or less into .iso images.
- echo The original folders will be deleted after each successful .iso image conversion/creation.
- echo;
- set /p UserChoice=Do you want to continue? (Y/N) :
- if /i "%UserChoice%" NEQ "Y" (
- echo;
- echo Stopping script.
- echo;
- pause
- ) else (
- echo;
- echo --- Beginning batch .iso image processing.
- for /d %%a in ("%target%\*") do (
- echo;
- pushd "%%a"
- for %%I in (.) do set GameName=%%~nxI
- echo ----------------------------------------------------------------------------------
- echo "!GameName!"
- set NameLength=!GameName!
- if "!NameLength:~32!"=="" (
- echo;
- echo Writing "!GameName!.iso"
- echo;
- xcopy /s "%source%\*" "%%a\"
- echo;
- cd _AuthHashTool
- _fciv.exe "..\!GameName!" -r -md5 -xml "!GameName!.xml"
- _fciv.exe "..\!GameName!" -r -md5 > "!GameName!.md5"
- (
- echo @echo off
- echo echo;
- echo echo Hashing "!GameName!" files.
- echo echo;
- echo _fciv.exe "..\!GameName!" -r -md5 -xml "!GameName!.xml"
- echo _fciv.exe "..\!GameName!" -r -md5 ^> "!GameName!.md5"
- echo echo;
- echo echo Successfully hashed "!GameName!" files.
- echo echo;
- echo pause
- ) > "_Create_Integrity_DB_!GameName!.bat"
- (
- echo @echo off
- echo echo;
- echo echo Verifying "!GameName!" files.
- echo echo;
- echo _fciv.exe -v -md5 -xml "!GameName!.xml"
- echo pause
- ) > "_Verify_Integrity_!GameName!.bat"
- popd
- OSCDIMG -u2 -m -l"!GameName!" "%%a" "%target%\!GameName!.iso"
- echo;
- if exist "%target%\!GameName!.iso" (
- for %%f in ("%target%\!GameName!.iso") do (
- if %%~zf EQU 0 (
- echo CAUTION^: %%~zf byte .iso image file detected.
- echo;
- echo Possible write error.
- echo Keeping original folder.
- ) else (
- echo Successfully written "!GameName!.iso"
- echo;
- echo Removing original folder.
- rmdir /S /Q "%target%\!GameName!"
- )
- )
- ) else (
- echo CAUTION^: "!GameName!.iso" is not found in expected location.
- echo;
- echo Possible write error.
- echo Keeping original folder.
- )
- echo ----------------------------------------------------------------------------------
- ) else (
- echo;
- echo ALERT ALERT ALERT ALERT ALERT
- echo;
- echo Folder name "!GameName!" exceeds 32 characters in length and cannot be used as an .iso image volume label.
- echo;
- echo ALERT ALERT ALERT ALERT ALERT
- echo;
- echo Skipping directory.
- echo ----------------------------------------------------------------------------------
- popd
- )
- )
- echo;
- echo --- Batch .iso image processing complete.
- echo;
- pause
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement