Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Re: batch scripting

Reply
 
Old 04-02-2009   #1 (permalink)
Jon Wallace


 
 

Re: batch scripting

Hi Jack,

Although this is a VBScript group I'm guessing from your title you want a
batch script? This should work for you...

@ECHO OFF

REG QUERY HKLM\SOFTWARE\MCAFEE > NUL
IF NOT ERRORLEVEL 1 GOTO :V80

REG QUERY HKLM\SOFTWARE\NETWORKASSIOCATES > NUL
IF NOT ERRORLEVEL 1 GOTO :V85

GOTO :END

:V80
REM Do V80 Stuff
ECHO V80
GOTO :END

:V85
REM Do V85 Stuff
ECHO V85
GOTO :END

:END
PAUSE

Hope this helps,
Jon

www.insidetheregistry.com

---

"Jack" <j.baltus@xxxxxx> wrote in message
news:d7b1b$49d51ddb$5ed32516$27005@xxxxxx
Quote:

> Hello,
>
>
> Can anybody help me with a script.
>
> I want check of there exist a registrykey, if not then check a other
> registrykey.
>
>
>
> like this.
>
>
>
> if exist reg hklm\software\mcafee then goto v80
> if exist reg hklm\software\networkassiocates then goto v85
>
> :v80
>
> goto end
>
>
> :v85
>
> goto end
>

My System SpecsSystem Spec
Old 04-02-2009   #2 (permalink)
Pegasus [MVP]


 
 

Re: batch scripting


"Jack" <j.baltus@xxxxxx> wrote in message
news:d7b1b$49d51ddb$5ed32516$27005@xxxxxx
Quote:

> Hello,
>
>
> Can anybody help me with a script.
>
> I want check of there exist a registrykey, if not then check a other
> registrykey.
>
>
>
> like this.
>
>
>
> if exist reg hklm\software\mcafee then goto v80
> if exist reg hklm\software\networkassiocates then goto v85
>
> :v80
>
> goto end
>
>
> :v85
>
> goto end
Here is a condensed version of Jon's suggestion:

@echo off
reg query hklm\software\mcafee 2>nul && goto V80
reg query hklm\software\networkassociates 2>nul && goto V80
goto :eof

:V80
REM Do V80 Stuff
ECHO V80
goto :eof

:V85
REM Do V85 Stuff
ECHO V85
goto :eof


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
DOS batch file -based installer going VS scripting - need moredirection VB Script
Scripting question Vista General
VB scripting help VB Script
UAC and scripting Vista General
Scripting bug? PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46