Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using REG QUERY to check for a certain string

Status
Not open for further replies.

Callahan

Technical User
Nov 21, 2001
174
GB
Can this be done? I want to run a batch file that will check if the correct entry is set in a reg key and if not change it to the correct entry. This is what I have so far:

REG QUERY "HKEY_USERS\.DEFAULT\Control Panel\Desktop" /v Wallpaper >NUL && set WALLPAPER=Correct

IF %WALLPAPER%==Correct (GOTO :INSTALL_POWEROFF) ELSE (GOTO :SET_DEFAULT_LOGON_WALLPAPER)

:SET_DEFAULT_LOGON_WALLPAPER
REG ADD "HKU\.DEFAULT\Control Panel\Desktop" /v Wallpaper /t reg_sz /d C:\WINDOWS\Web\Wallpaper\ffback.bmp /f

It works as there is always something set in the Wallpaper entry but this can be any setting, usually the default OEM wallpaper. What I want to do is query the registry for a specific path such as: C:\WINDOWS\Web\Wallpaper\ffback.bmp.

Can this be done?

Thanks for any suggestions you can give.

 
I am currently doing that but as there are at least 3 batch files that run during logon to set up various things I wanted to make this one as streamlined as possible so that it executes quickly. For one thing it prevents the user from killing the batch window if it only appears very briefly.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top