Advertisement
Guest User

BatchCreateGameISOs

a guest
May 10th, 2024
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.00 KB | Gaming | 0 0
  1. @echo off
  2. setlocal enabledelayedexpansion
  3. set "source=C:\Users\---user folder here---\Desktop\AuthHashTool"
  4. set "target=C:\Users\---user folder here---\Desktop\Games"
  5. Cd "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\Oscdimg"
  6. echo;
  7. echo CAUTION^:
  8. echo;
  9. echo This script will convert all folders in "Games" which have names with 32 characters or less into .iso images.
  10. echo The original folders will be deleted after each successful .iso image conversion/creation.
  11. echo;
  12. set /p UserChoice=Do you want to continue? (Y/N) :
  13. if /i "%UserChoice%" NEQ "Y" (
  14. echo;
  15. echo Stopping script.
  16. echo;
  17. pause
  18. ) else (
  19. echo;
  20. echo --- Beginning batch .iso image processing.
  21. for /d %%a in ("%target%\*") do (
  22. echo;
  23. pushd "%%a"
  24. for %%I in (.) do set GameName=%%~nxI
  25. echo ----------------------------------------------------------------------------------
  26. echo "!GameName!"
  27. set NameLength=!GameName!
  28. if "!NameLength:~32!"=="" (
  29. echo;
  30. echo Writing "!GameName!.iso"
  31. echo;
  32. xcopy /s "%source%\*" "%%a\"
  33. echo;
  34. cd _AuthHashTool
  35. _fciv.exe "..\!GameName!" -r -md5 -xml "!GameName!.xml"
  36. _fciv.exe "..\!GameName!" -r -md5 > "!GameName!.md5"
  37.  
  38. (
  39. echo @echo off
  40. echo echo;
  41. echo echo Hashing "!GameName!" files.
  42. echo echo;
  43. echo _fciv.exe "..\!GameName!" -r -md5 -xml "!GameName!.xml"
  44. echo _fciv.exe "..\!GameName!" -r -md5 ^> "!GameName!.md5"
  45. echo echo;
  46. echo echo Successfully hashed "!GameName!" files.
  47. echo echo;
  48. echo pause
  49.  
  50. ) > "_Create_Integrity_DB_!GameName!.bat"
  51.  
  52. (
  53. echo @echo off
  54. echo echo;
  55. echo echo Verifying "!GameName!" files.
  56. echo echo;
  57. echo _fciv.exe -v -md5 -xml "!GameName!.xml"
  58. echo pause
  59.  
  60. ) > "_Verify_Integrity_!GameName!.bat"
  61.  
  62. popd
  63. OSCDIMG -u2 -m -l"!GameName!" "%%a" "%target%\!GameName!.iso"
  64. echo;
  65. if exist "%target%\!GameName!.iso" (
  66. for %%f in ("%target%\!GameName!.iso") do (
  67. if %%~zf EQU 0 (
  68. echo CAUTION^: %%~zf byte .iso image file detected.
  69. echo;
  70. echo Possible write error.
  71. echo Keeping original folder.
  72. ) else (
  73. echo Successfully written "!GameName!.iso"
  74. echo;
  75. echo Removing original folder.
  76. rmdir /S /Q "%target%\!GameName!"
  77. )
  78. )
  79. ) else (
  80. echo CAUTION^: "!GameName!.iso" is not found in expected location.
  81. echo;
  82. echo Possible write error.
  83. echo Keeping original folder.
  84. )
  85. echo ----------------------------------------------------------------------------------
  86. ) else (
  87. echo;
  88. echo ALERT ALERT ALERT ALERT ALERT
  89. echo;
  90. echo Folder name "!GameName!" exceeds 32 characters in length and cannot be used as an .iso image volume label.
  91. echo;
  92. echo ALERT ALERT ALERT ALERT ALERT
  93. echo;
  94. echo Skipping directory.
  95. echo ----------------------------------------------------------------------------------
  96. popd
  97. )
  98. )
  99. echo;
  100. echo --- Batch .iso image processing complete.
  101. echo;
  102. pause
  103. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement