Home All Groups Group Topic Archive Search About

Check for reg entry and run cmd if not there



Author
12 Mar 2007 4:13 PM
Brandur Holm Petersen
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.

Author
13 Mar 2007 10:24 AM
Brandur Holm Petersen
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
exit

But if anyone knows how to do this in a vbs script please post. And as you
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.

AddThis Social Bookmark Button