Jump to content

QuickLaunch & Taskbar: Simplissimo!


Recommended Posts

Here is the information I sent to Djé.

I have only really changed

  • The regedit stuff to ignore unicode altogether!
    Merged the two files together which I had initially left as seperate files.

@ECHO OFF
>NUL PUSHD %~dp0
IF "%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 Launch
IF NOT EXIST _QK_LNCH (IF NOT EXIST _TASKBAR.REG (
ECHO/ No backups found in %~dp0
ECHO/ Use %~n0 to create a backup first.))
SETLOCAL
SET "QL=Microsoft\Internet Explorer\Quick Launch"
XCOPY _QK_LNCH "%APPDATA%\%QL%" /IQHRKY >NUL 2>&1
REGEDIT /S _TASKBAR.REG 2>NUL
GOTO END

:BACKUP
TITLE Taskbar and Quick Launch Back-up
SETLOCAL
SET "QL=Microsoft\Internet Explorer\Quick Launch"
SET "EX=HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer"
XCOPY "%APPDATA%\%QL%" _Qk_Lnch /DIQHRKY >NUL 2>&1
REGEDIT/A _TASKBAR.REG %EX%\Streams\Desktop
REGEDIT/A _X_.REG %EX%\StuckRects2
FOR /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_.REG
ECHO/
ECHO/ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO/ Taskbar settings and QuickLaunch shortcuts backed-up to
ECHO/ %~dp0
ECHO/ To restore to the system, just use the command: %~n0 [-r^|/r]
ECHO/ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO/

:END
>NUL PING -n 6 LOCALHOST
GOTO :EOF

Lets 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 by Yzöwl
Link to comment
Share on other sites


Yzöwl,

- That's not fair: You're the batch-guru, you can allow yourself the batch-guru-powered-FOR blablabla. :P

But I fail to understand the purpose of the 1st Findstr with line numbers. :blink:

(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. :thumbup

Link to comment
Share on other sites

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

:w00t: 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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...