@s1ave77 Can you help me one more Restore command that apply for windows 8 . I want to restore 2 files data.dat & tokens.dat to the path : C:\Windows\System32\spp\store and the key that I used to activate. For example the key : 12345-abcde-12345-abcde-12345. I tried to follow your command ... but it does not work .. please help me. thanks so much in advance.
Give me a moment . Code: @echo off setlocal ENABLEDELAYEDEXPANSION net stop sppsvc takeown /F %systemroot%\System32\spp\store /A /R del "%systemroot%\System32\spp\store\tokens.dat" /S /Q del /AH "%systemroot%\System32\spp\store\data.dat" /S /Q xcopy "%~dp0tokens.dat" "%windir%\system32\spp\store" /S /Q /Y xcopy /H "%~dp0data.dat" "%windir%\system32\spp\store" /S /Q /Y cscript %systemroot%\System32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX net start sppsvc pause ENDLOCAL exit Needed a moment to find /H and /AH switches to copy/delete hidden system files .
Think this will work also... Code: @ECHO OFF cd %~dp0 net stop sppsvc net stop sppsvc del /s /f /q %systemroot%\system32\spp\store\*.dat del /ah /s /f /q %systemroot%\system32\spp\store\*.dat COPY /y data.dat %windir%\System32\spp\store\data.dat COPY /Y tokens.dat %windir%\System32\spp\store\tokens.dat attrib -R -A %systemroot%\system32\spp\store\*.dat /S cscript %windir%\system32\slmgr.vbs /ipk xxxxx-xxxxx-xxxxx-xxxxx-xxxxx cscript %windir%\system32\slmgr.vbs /dlv exit
@s1ave77 I just gave a test .... It works well... if I skip the command line " cscript %systemroot%\System32\slmgr.vbs /ipk XXXXX-XXXXX-XXXXX-XXXXX-XXXXX " Thanks again Bro. BTW, Can you help me a .CMD file to copy 2 files " tokens.dat & data.dat " ? I do not like to copy these files manually. this .CMD file including: 1. It automatically creates a folder on Desktop named Windows 8 Back-up 2. Path for " tokens.dat & data.dat " C:\Windows\System32\spp\store 3. It has " Press any key to open Windows 8 Back-up" as it completes copying these 2 files. Thanks so much in advance. Have a good day, Bro.
Code: @echo off setlocal ENABLEDELAYEDEXPANSION net stop sppsvc md "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" xcopy /H "%windir%\system32\spp\store\data.dat" "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" /S /Q /Y xcopy "%windir%\system32\spp\store\tokens.dat" "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" /S /Q /Y net start sppsvc pause ENDLOCAL exit
I know that Xs are my Product key .... the thing is that if my product key is exceed time limit to activate online .... therefore I SKIP that line .... It works .... I try and keep that line .... it automatically activates online .... then it shows that Windows is NOT activated ! thanks again Bro.
Thanks Bro. Can you add one more command line in order that I press Enter it will open Windows 8 Back-up folder after finish copying like " Press any key to Open Windows 8 Back-up "
Code: @echo off setlocal ENABLEDELAYEDEXPANSION net stop sppsvc md "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" xcopy /H "%windir%\system32\spp\store\data.dat" "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" /S /Q /Y xcopy "%windir%\system32\spp\store\tokens.dat" "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" /S /Q /Y net start sppsvc pause ENDLOCAL Explorer "%systemdrive%\users\%username%\desktop\Windows 8 Back-up" exit And why is %systemdrive%\users\%username%\desktop\ being used when it could be %userprofile%\desktop. Also, if anyone has their main account they use as a standard user and have the administrator account activated and passworded then the files will be put on the administrators account desktop (if ran as admin) and not on the current users.
Humphrey is right Code: @echo off setlocal ENABLEDELAYEDEXPANSION net stop sppsvc md "%userprofile%\desktop\Windows 8 Back-up" xcopy /H "%windir%\system32\spp\store\data.dat" "%userprofile%\desktop\Windows 8 Back-up" /S /Q /Y xcopy "%windir%\system32\spp\store\tokens.dat" "%userprofile%\desktop\Windows 8 Back-up" /S /Q /Y net start sppsvc pause ENDLOCAL Explorer "%userprofile%\desktop\Windows 8 Back-up" exit
To create subfolder at actual location of the script, this avoids trouble in case several users are availeable: Code: @echo off setlocal ENABLEDELAYEDEXPANSION net stop sppsvc md "%~dp0Windows 8 Back-up" xcopy /H "%windir%\system32\spp\store\data.dat" "%~dp0Windows 8 Back-up" /S /Q /Y xcopy "%windir%\system32\spp\store\tokens.dat" "%~dp0Windows 8 Back-up" /S /Q /Y net start sppsvc pause ENDLOCAL Explorer "%~dp0Windows 8 Back-up" exit
Would it not be better to use more up to date tools than NET, XCOPY and PAUSE! Code: @ECHO OFF SETLOCAL SET "DSTD=Windows 8 Back-up" SC STOP sppsvc PUSHD %~dp0 ROBOCOPY "%SYSTEMROOT%\SYSTEM32\SPP\STORE" "%DSTD%" data.dat tokens.dat SC START sppsvc CHOICE /C YC /M "Press Y to Open %DSTD% Folder, C to Close" /T 10 /D Y IF ERRORLEVEL 2 GOTO :EOF START "" EXPLORER "%DSTD%"
Anyone can figure out this problem I am writing this code to a batch file and it's coming out silly ...lol Here is the write: Code: echo @echo off >%SystemDrive%\Trial\IR7\IR7.bat echo title IR7 >>%SystemDrive%\Trial\IR7\IR7.bat echo mode con: cols=51 lines=2 >>%SystemDrive%\Trial\IR7\IR7.bat md %SystemDrive%\Trial\IR7\IR7.bat >nul 2>&1 echo SET file=%SystemDrive%\Trial\IR7 >>%SystemDrive%\Trial\IR7\IR7.bat echo IF EXIST %file% attrib -h %file% >>%SystemDrive%\Trial\IR7\IR7.bat echo rd /S /Q %file% >>%SystemDrive%\Trial\IR7\IR7.bat Here is it written incorrectly: Code: SET file=C:\Trial IF EXIST \\?\Volume{5b0538e0-d236-11e2-80b1-806e6f6e6963}\\IR7.bat attrib -h \\?\Volume{5b0538e0-d236-11e2-80b1-806e6f6e6963}\\IR7.bat rd /S /Q \\?\Volume{5b0538e0-d236-11e2-80b1-806e6f6e6963}\\IR7.bat It should be written like this: Code: SET file=%SystemDrive%\Trial\IR7 IF EXIST %file% attrib -h %file% rd /S /Q %file% This work is being done in my Duality 420 thread and any help would awesome It will write semi-correctly on it's own but in my full batch file it acts weird ...lol
Try this Code: echo @echo off >%SystemDrive%\Trial\IR7\IR7.bat echo title IR7 >>%SystemDrive%\Trial\IR7\IR7.bat echo mode con: cols=51 lines=2 >>%SystemDrive%\Trial\IR7\IR7.bat md %SystemDrive%\Trial\IR7\IR7.bat >nul 2>&1 echo SET file=%SystemDrive%\Trial\IR7 >>%SystemDrive%\Trial\IR7\IR7.bat echo IF EXIST %%file%% attrib -h %%file%% >>%SystemDrive%\Trial\IR7\IR7.bat echo rd /S /Q %%file%% >>%SystemDrive%\Trial\IR7\IR7.bat
Thank you for your help once more It is writing correctly now Come to my Rearm Wizard thread and check out the latest build... It will be up in a little bit with whole new first post... See you later...