the scrip works fine but does not delete the directory... under windows 10 RMDIR /S /Q "C:\Windows\Setup\Scripts" Code: @ECHO OFF cd %~dp0 start /wait Silverlight_x64.exe /Q start /wait Windows-KB890830-x64-V5.31.exe /Q @echo off pushd %~dp0 ::::::::::BEGIN ACTIVATION STUFF:::::::::::::::::::::: :Install Exclusion in Windows Defender for future blocks. Has to be done during Windows Setup or you won't have permissions. REG ADD "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" /v "%WinDir%\AutoKMS\AutoKMS.exe" /D 0 /T REG_DWORD /F :Activate Windows %WinDir%\AutoKMS\AutoKMS.exe set status= for /l %%x in (1, 1, 3) do ( for /f "tokens=2 delims== " %%A in ('"wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list"') do ( if %%A geq 1 set status=%%A ) if %status% EQU 1 Goto :END-ACTIVATION-STUFF %WinDir%\AutoKMS\AutoKMS.exe ) :END-ACTIVATION-STUFF RMDIR /S /Q "C:\Windows\Setup\Scripts" exit
Any readonly leftover in Scripts folder? Try this: cd\ rd /s /q %WinDir%\Setup\Scripts >nul 2>&1 exit
for /l %%x in (1, 1, 3) do ( for /f "tokens=2 delims== " %%A in ('"wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list"') do ( if %%A geq 1 set status=%%A ) if %status% EQU 1 Goto :END-ACTIVATION-STUFF %WinDir%\AutoKMS\AutoKMS.exe ) How about? for /l %%x in (1, 1, 3) do ( for /f "tokens=2 delims== " %%A in ('"wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list"') do ( if %%A NEQ 1 %WinDir%\AutoKMS\AutoKMS.exe ) ) Edit: I found such command is not good enough Code: C:\windows\system32>wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list LicenseStatus=0 LicenseStatus=0 LicenseStatus=1 LicenseStatus=0 LicenseStatus=0 LicenseStatus=0 LicenseStatus=0 LicenseStatus=0
don,t understand but think that i may have the correct line now as: RD /S /Q "%systemroot%\Setup\SCRIPTS"
No worries. Your original script about activation status check is OK. But I still do not think it is good enough. Code: Name LIKE '%%Windows%%' For example, what if Windows is NOT Volume edition? Anyway, it will be alright if you make sure that 1. Volume edition is being used 2. The AutoKMS.exe will convert/activate Non-Volume edition
You did not use cd\? What files are in Scripts folder? These three and the script? start /wait Silverlight_x64.exe /Q start /wait Windows-KB890830-x64-V5.31.exe /Q AutoKMS.exe Could you upload your files (Scripts folder) for me to have a test on my PC?
yes used "cd" files are Silverlight_x64.exe Windows-KB890830-x64-V5.31.exe Setupcomplete.cmd OOBE.cmd only files that gets deleted is OEMInformation.reg
Maybe OOBE.cmd is still runng while deleting Scripts folder. If this is the case, then you need to use registry RunOnce to delete Scripts folder at next boot.
its run as this delets the oeminformation.reg file Code: @echo off IF EXIST %windir%\HKCU.vbs reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v Run1 /t REG_SZ /d "%windir%\HKCU.vbs" /f >nul start /w regedit /s %systemroot%\setup\scripts\OEMInformation.reg del /F /Q %systemroot%\setup\scripts\OEMInformation.reg
I suggest that you have a look at Heldigard script. He uses such method to remove Scripts folder at reboot. SetupComplete.cmd Code: @ECHO OFF pushd "%~dp0" start /wait KMSpico_setup.exe /verysilent /noicons regedit /s RunOnce.reg timeout /t 120 shutdown -r -t 0 popd exit RunOnce.reg Code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce] "01-ReActivate"="C:\\Program Files\\KMSpico\\KMSELDI.exe /silent" "02-Clean"="C:\\Windows\\Setup\\Scripts\\Clean.cmd" Clean.cmd Code: @ECHO OFF RMDIR /S /Q "C:\Windows\Setup\Scripts" RD /S /Q "C:\Windows\Setup\Scripts" exit
I reproduced the situation you mentioned above and applied it on VL 10586 Pro. No, it did not work. Code: ---------------------------------------- AutoKMS 2.6.0.0 Ran At 2015/12/12 下午 09:51:14. Using built-in KMS Server Emulator. Attempting To Activate Microsoft Windows Attempting to Activate Professional <Product activation successful> ---------------------------------------- ---------------------------------------- AutoKMS 2.6.0.0 Ran At 2015/12/12 下午 09:51:54. Using built-in KMS Server Emulator. Attempting To Activate Microsoft Windows Attempting to Activate Professional <Product activation successful> ---------------------------------------- Could you tell me why you use Windows-KB890830-x64-V5.31.exe? It is preinstalled package, isn't it?
Got it working now setupcomplete Code: @ECHO OFF cd %~dp0 start /wait Silverlight_x64.exe /Q start /wait Windows-KB890830-x64-V5.31.exe /Q regedit /s RunOnce.reg ::::::::::BEGIN ACTIVATION STUFF:::::::::::::::::::::: :Install Exclusion in Windows Defender for future blocks. Has to be done during Windows Setup or you won't have permissions. REG ADD "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" /v "%WinDir%\AutoKMS\AutoKMS.exe" /D 0 /T REG_DWORD /F :Activate Windows %WinDir%\AutoKMS\AutoKMS.exe set status= for /l %%x in (1, 1, 3) do ( for /f "tokens=2 delims== " %%A in ('"wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list"') do ( if %%A geq 1 set status=%%A ) if %status% EQU 1 Goto :END-ACTIVATION-STUFF %WinDir%\AutoKMS\AutoKMS.exe ) :END-ACTIVATION-STUFF exit RunOnce Code: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce] "01-Clean"="C:\\Windows\\Setup\\Scripts\\Clean.cmd" Clean Code: @ECHO OFF RMDIR /S /Q "C:\Windows\Setup\Scripts" RD /S /Q "C:\Windows\Setup\Scripts" exit Thank you
That setupcomplete looks a lot like the one murphy78 uses in his releases? @xinso: that kb is the monthly released "malicious software removal tool".
It worked as of: Code: @ECHO OFF cd %~dp0 start /wait Silverlight_x64.exe /Q start /wait Windows-KB890830-x64-V5.31.exe /Q @echo off pushd %~dp0 ::::::::::BEGIN ACTIVATION STUFF:::::::::::::::::::::: :Install Exclusion in Windows Defender for future blocks. Has to be done during Windows Setup or you won't have permissions. REG ADD "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" /v "%WinDir%\AutoKMS\AutoKMS.exe" /D 0 /T REG_DWORD /F :Activate Windows %WinDir%\AutoKMS\AutoKMS.exe cd\ RD /S /Q "C:\Windows\Setup\Scripts" exit So... There is problem in HERE: Code: @ECHO OFF cd %~dp0 start /wait Silverlight_x64.exe /Q start /wait Windows-KB890830-x64-V5.31.exe /Q @echo off pushd %~dp0 ::::::::::BEGIN ACTIVATION STUFF:::::::::::::::::::::: :Install Exclusion in Windows Defender for future blocks. Has to be done during Windows Setup or you won't have permissions. REG ADD "HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths" /v "%WinDir%\AutoKMS\AutoKMS.exe" /D 0 /T REG_DWORD /F :Activate Windows %WinDir%\AutoKMS\AutoKMS.exe set status= for /l %%x in (1, 1, 3) do ( for /f "tokens=2 delims== " %%A in ('"wmic path SoftwareLicensingProduct where (Name LIKE '%%Windows%%') get LicenseStatus /format:list"') do ( if %%A geq 1 set status=%%A ) if %status% EQU 1 Goto :END-ACTIVATION-STUFF %WinDir%\AutoKMS\AutoKMS.exe ) :END-ACTIVATION-STUFF RMDIR /S /Q "C:\Windows\Setup\Scripts" exit BTW, there is another error occured before running AUTOKMS.exe Code: 錯誤: 存取被拒。 (Error: Access denied.) ---------------------------------------- AutoKMS 2.6.0.0 Ran At 2015/12/12 下午 11:00:56. Using built-in KMS Server Emulator. Attempting To Activate Microsoft Windows
Thanks, we as for the stuff in red i really dont know what it does anyway - hopefully murphy78 can help with that as e just may be the original code maker for it