New
#21
What would be real nice is if you merged your additional options into my existing Image Health options....
As I provide an option to use Latest ADK Dism Files - which allows Image Health to also run on windows 7
What would be real nice is if you merged your additional options into my existing Image Health options....
As I provide an option to use Latest ADK Dism Files - which allows Image Health to also run on windows 7
I just found a subtle difference. See the test results below:
I put it in a .bat file "E:\$ Testing\Kyhi.bat" and ran it. The output was:
The code does not work because the file path contains a space.Code:'E:\$' is not recognized as an internal or external command, operable program or batch file. C:\Windows\system32>
I put it in a .bat file "E:\$ Testing\Matthew.bat" and ran it. The output was:My code works even if the file path contains a space.Code:Hello Press any key to continue . . .
our test results vary - as I just tested > "Test$ Admin.cmd" and > "Test Admin.cmd"
ie with space and a special character - also tested as .bat
The file name "$ Matthew.bat" works.
The file name "$Matthew.bat" does not work.
The file name "%Matthew.bat" works.
The file name "@Matthew.bat" works.
That is baffling.
Code::: Clean Up the WinSxS Folder @Echo off (Net session >nul 2>&1)||(PowerShell start """%~0""" -verb RunAs & Exit /B) Cls & Mode CON LINES=12 COLS=80 & Color 1E & Title Created by FREEBOOTER Reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 8" >Nul If Not Errorlevel 1 ( Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase ) Else ( Reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 8.1" >Nul If Not Errorlevel 1 ( Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase ) Else ( Reg QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v ProductName | find /i "Windows 10" >Nul If Not Errorlevel 1 ( Dism /Online /Cleanup-Image /StartComponentCleanup /ResetBase ) Else ( Goto :EOF ) ) ) Ping -n 10 localhost >Nul
I think FreeBooter's code can be simplified as below:
Dism.exe will be run as long as the OS is Windows 8 or above.Code:For /f "tokens=2 delims==" %%# in ( 'wmic path Win32_OperatingSystem get BuildNumber /value') do (set /a WinBuild=%%#) If %winbuild% LEQ 7601 (Goto :EOF) else ( Dism.exe /online /Cleanup-Image /StartComponentCleanup /ResetBase)
Code:Set "SFC=%UserProfile%\Desktop\SFC_Errors.txt"%UserProfile%\Desktop\
does not work if the desktop has been relocated: Move Location of Desktop Folder in Windows 10
The following works even if the desktop has been relocated:Credit goes to Try3.Code:For /F "usebackq tokens=3 " %%X in ( `Reg Query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop`) Do ( Set 👽=%%X) For /F "usebackq delims=" %%Y in (`Echo %👽%`) Do (Set ❤️=%%Y) Set "SFC=%❤️%\SFC_Errors.txt"
Thank You Matt for sharing that code...
@Try3 Several members have set me code to adjust "Image Health" to work with relocated Personal folders - Your code is the only one found to work...
Thank You
Paul I adjusted *.cmd - to allow "folder relocation" to work with prior PM attachment (new pm sent)