Below are the listed functions that this script will be doing that chatgpt wrote out for me so when you run this it will create three folders called “echo” “is” “on” edit this script as you would like let me know what you come up with my Click HERE for my Twitter
- Querying the registry for the value of “TargetOS” under “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RecoveryEnvironment”.
- Using this information to set the environment variable “TARGETOSDRIVE” to the drive letter of the operating system.
- Copying several files related to the Windows layout and appearance.
- Copying shortcuts to the public desktop.
- Deleting certain shortcuts.
- Adding a registry key to “HKLM\TempReg\Microsoft\Windows Search” to improve system performance.
- Running a recovery command if a specific file exists.
- Error checking: The script does not include any error checking to ensure that the registry query or file operations are successful. It would be a good idea to add error handling to ensure that the script fails gracefully in case of any errors.
- Hardcoded paths: Some of the paths used in the script are hardcoded and may not be applicable to all systems. It would be a good idea to use environment variables or other dynamic means of determining the paths, to make the script more flexible and reusable.
- Explanation of recovery command: The recovery command at the end of the script is not well-explained, and it would be a good idea to provide more information on what it does and why it is being run.
Save the below code as a .bat or a .cmd file Enjoy
for /F "tokens=1,2,3 delims= " %%A in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RecoveryEnvironment" /v TargetOS') DO SET TARGETOS=%%C
for /F "tokens=1 delims=\" %%A in ('Echo %TARGETOS%') DO SET TARGETOSDRIVE=%%A
copy /y %TARGETOSDRIVE%\Recovery\OEM\Unattend.xml %TARGETOSDRIVE%\Windows\panther
copy /y %TARGETOSDRIVE%\Recovery\OEM\LayoutModification.xml %TARGETOSDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\Shell\
copy /y %TARGETOSDRIVE%\Recovery\OEM\LayoutModification.json %TARGETOSDRIVE%\Users\Default\AppData\Local\Microsoft\Windows\Shell\
copy /y %TARGETOSDRIVE%\Recovery\OEM\TaskbarLayoutModification.xml %TARGETOSDRIVE%\Windows\OEM\
xcopy /cherky %TARGETOSDRIVE%\Recovery\OEM\Info %TARGETOSDRIVE%\Windows\System32\OOBE\info\
md %TARGETOSDRIVE%\Windows\ASUS\OOBEProc
echo if exist C:\Intel attrib +h C:\Intel >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\OOBEIns.cmd
echo if exist C:\PerfLogs attrib +h C:\PerfLogs >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\OOBEIns.cmd
echo attrib +h C:\*.* >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\OOBEIns.cmd
echo if exist C:\Intel attrib +h C:\Intel >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsLogonIns.cmd
echo if exist C:\PerfLogs attrib +h C:\PerfLogs >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsLogonIns.cmd
echo attrib +h C:\*.* >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsLogonIns.cmd
echo if exist C:\Intel attrib +h C:\Intel >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsusLogonIns.cmd
echo if exist C:\PerfLogs attrib +h C:\PerfLogs >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsusLogonIns.cmd
echo attrib +h C:\*.* >> %TARGETOSDRIVE%\Windows\ASUS\OOBEProc\AsusLogonIns.cmd
rem OEM setting
copy /y %TARGETOSDRIVE%\Windows\ASUS\Shortcuts\*.lnk %TARGETOSDRIVE%\Users\Public\Desktop\
del /s /q "%TARGETOSDRIVE%\Users\Public\Desktop\Media Player Center.lnk"
del /s /q "%TARGETOSDRIVE%\Users\Public\Desktop\Messenger Center.lnk"
del /s /q "%TARGETOSDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Media Player Center.lnk"
del /s /q "%TARGETOSDRIVE%\ProgramData\Microsoft\Windows\Start Menu\Programs\Messenger Center.lnk"
rem Fix PC becomes sluggish
REG LOAD HKLM\TempReg "%TARGETOSDRIVE%\Windows\System32\config\SOFTWARE"
REG ADD "HKLM\TempReg\Microsoft\Windows Search" /v RebuildIndex /t REG_DWORD /d 7 /f
REG UNLOAD HKLM\TempReg
rem Recovery Comman
if exist %~dp0oemsetupRecovery.OEMTA.4287.cmd call %~dp0oemsetupRecovery.OEMTA.4287.cmd
#//Coded by Taylor Christian Newsome https://twitter.com/ClumsyLulz https://www.linkedin.com/in/clumsy