|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Check for reg entry and run cmd if not there
I'm new to vbs scripting. Just used batch scripting. So here goes...
I vould like to check for a string in the regestry ([HKEY_LOCAL_MACHINE\SOFTWARE\Føroya Fróðskaparfelag\Stavarin]), if this string is there then exit, but if it's not there, then call a batch file or install a program. The script has to be able to use domain credentials, so install on clients will not be rejected(is there any whay to hide administrator password?). Please could somone give me an exsample on how this might be accomplished. I hope someone can healp me on this issue. Thank you. I solved ths with batch script that looks like this:
@echo off IF EXIST "%SystemDrive%\Program Files\FolderName" goto EXIT copy \\share\programname.exe %TEMP% /y "%TEMP%\programname.exe" /SILENT :exit But if anyone knows how to do this in a vbs script please post. And as you exit can see, i'm checking on foldername and not regestry string as i would like to. But this simple script at least does the job. Show quote "Brandur Holm Petersen" wrote: > I'm new to vbs scripting. Just used batch scripting. So here goes... > > I vould like to check for a string in the regestry > ([HKEY_LOCAL_MACHINE\SOFTWARE\Føroya Fróðskaparfelag\Stavarin]), if this > string is there then exit, but if it's not there, then call a batch file or > install a program. > The script has to be able to use domain credentials, so install on clients > will not be rejected(is there any whay to hide administrator password?). > > Please could somone give me an exsample on how this might be accomplished. > I hope someone can healp me on this issue. > > Thank you. |
|||||||||||||||||||||||