Yzöwl Posted June 8, 2006 Share Posted June 8, 2006 (edited) Here is the information I sent to Djé. I have only really changedThe regedit stuff to ignore unicode altogether!Merged the two files together which I had initially left as seperate files.@ECHO OFF>NUL PUSHD %~dp0IF "%1" EQU "" (GOTO BACKUP)ECHO %* |FINDSTR/I [-/]R >NUL 2>&1 ||( ECHO/ Invalid Switch! ECHO/ Use %~n0 [-r^|/r] to restore. GOTO END)TITLE Restoring Taskbar and Quick LaunchIF NOT EXIST _QK_LNCH (IF NOT EXIST _TASKBAR.REG ( ECHO/ No backups found in %~dp0 ECHO/ Use %~n0 to create a backup first.))SETLOCALSET "QL=Microsoft\Internet Explorer\Quick Launch"XCOPY _QK_LNCH "%APPDATA%\%QL%" /IQHRKY >NUL 2>&1REGEDIT /S _TASKBAR.REG 2>NULGOTO END:BACKUPTITLE Taskbar and Quick Launch Back-upSETLOCALSET "QL=Microsoft\Internet Explorer\Quick Launch"SET "EX=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer"XCOPY "%APPDATA%\%QL%" _Qk_Lnch /DIQHRKY >NUL 2>&1REGEDIT/A _TASKBAR.REG %EX%\Streams\DesktopREGEDIT/A _X_.REG %EX%\StuckRects2FOR /F "SKIP=1 TOKENS=1* DELIMS=:" %%a IN ( 'FINDSTR/N ".*" _X_.REG ^|FINDSTR/VIC:"\"UPGRADE\"="') DO ( IF ERRORLEVEL 0 (>>_TASKBAR.REG ECHO/%%b))DEL _X_.REGECHO/ECHO/ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»ECHO/ Taskbar settings and QuickLaunch shortcuts backed-up toECHO/ %~dp0ECHO/ To restore to the system, just use the command: %~n0 [-r^|/r]ECHO/ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼECHO/:END>NUL PING -n 6 LOCALHOSTGOTO :EOFLets hope it helps quell some of the bickering!<Edit>Had to edit because '%%b)' looked like '%%B)'Added the /I switch to XCOPY as noted below by Djé</Edit> Edited June 9, 2006 by Yzöwl Link to comment Share on other sites More sharing options...
Djé Posted June 8, 2006 Author Share Posted June 8, 2006 Yzöwl,- That's not fair: You're the batch-guru, you can allow yourself the batch-guru-powered-FOR blablabla. But I fail to understand the purpose of the 1st Findstr with line numbers. (And BTW, you inversed the 2 reg keys so the 2nd Findstr doesn't find anything).- One day you'll have to tell me where you find those switches. I tried <-|/><?|h[elp]> on Regedit, to no avail.I suppose this /A is for ANSI?- I have no bickering to quell; except maybe with myself taking your writings for the holy 'batch for dummies' without checking the result: your xcopy command in restore mode is missing the /I switch to fix the "QL folder doesn't exist yet at first RunOnceEx" bug, as is now mentionned on the 1st page. But who would know that before stomping on it?-Now, I must agree, the Unicode is not needed for those 2 reg keys.But if this script is to serve as an example for other registry export (who knows), non English systems users may be happy to find it as it is. Especially as Unicode is used at no expense since the last version of the script.And thanks again for all the fish your other ideas that I re-used in this script. Link to comment Share on other sites More sharing options...
Yzöwl Posted June 8, 2006 Share Posted June 8, 2006 The /A switch is for ANSI export as you will see from the REGEDIT4 header in the output. I got it sent to me in the Secret Batch Gurus Almanac, which I had to destroy upon reading.There are two FINDSTR's, the first with the /N switch adds line numbers as you say, the second removes the unwanted value line if it exists. They are correct, the first is used for 'Guru' purposes, which may not be obvious. Link to comment Share on other sites More sharing options...
Djé Posted June 9, 2006 Author Share Posted June 9, 2006 I got it! this first findstr is for preserving the blank lines, isn't it? Oh you gurus... Link to comment Share on other sites More sharing options...
Yzöwl Posted June 9, 2006 Share Posted June 9, 2006 The Batch Guru CODE unfortunately forbids me to return a positive response on this occasion! Link to comment Share on other sites More sharing options...
Bilou_Gateux Posted June 9, 2006 Share Posted June 9, 2006 (edited) Thanks to you, 'mangeurs de cuisses de grenouilles' 'froggies' en français dans le texte.i will check it later but i'm sure it's now 100% debugged and error free with Yzowl UK batch GURU ISO 9001 certification Edited June 9, 2006 by Bilou_Gateux Link to comment Share on other sites More sharing options...
Djé Posted June 9, 2006 Author Share Posted June 9, 2006 I didn't know, but there's also an Yzöwl14001 Certification. This one must have an even more exclusive Almanach!Maybe you have to read it in the dark. Just as it burns... B) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now