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 - vbscript if reg exist .....

Reply
 
Old 09-24-2008   #1 (permalink)
deen


 
 

vbscript if reg exist .....

PLease urgent help

i run the script as a .vbs nothing happens. the key is not removed.
i have confirmed the key "{264600DE-0879-4231-9F93-9CE3D503DFC1}"
and the key diffenatelty exist.


strUninstallRMS6 = "\\lbnfilr002\Packages\PkgsQ-T\RMS" _
& "\RMS63\uninstallRMS6.bat"
sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
& "\Uninstall\{264600DE-0879-4231-9F93-9CE3D503DFC1}\"
if CStr(CheckRegKey(sKey)) then
set WshShell = CreateObject("WScript.Shell")
WSHShell.Run strUninstallRMS6, 1 , FALSE
end if


Function CheckRegKey(sKey)
On Error Resume next
with CreateObject("WScript.Shell")
.RegRead sKey
end with
CheckRegKey = (Err.Number = 0)
On Error Goto 0
end function

--------------------------------------------------------------------------

Ive tested the below and it definately works. i need the if statment
to work.

set WshShell = WScript.CreateObject("WScript.Shell")
strUninstallRMS6 = "\\lbnfilr002\Packages\PkgsQ-T\RMS
\RMS63\uninstallRMS6.bat"

WSHShell.Run strUninstallRMS6, 1 , FALSE
WScript.Quit

PLease urgent help

thanks

My System SpecsSystem Spec
Old 09-24-2008   #2 (permalink)
Pegasus \(MVP\)


 
 

Re: vbscript if reg exist .....

Have a look at the three other threads you started on this topic.


"deen" <an509@xxxxxx> wrote in message
news:819e1b07-82c4-4173-b986-f83a457aeb23@xxxxxx
Quote:

> PLease urgent help
>
> i run the script as a .vbs nothing happens. the key is not removed.
> i have confirmed the key "{264600DE-0879-4231-9F93-9CE3D503DFC1}"
> and the key diffenatelty exist.
>
>
> strUninstallRMS6 = "\\lbnfilr002\Packages\PkgsQ-T\RMS" _
> & "\RMS63\uninstallRMS6.bat"
> sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion" _
> & "\Uninstall\{264600DE-0879-4231-9F93-9CE3D503DFC1}\"
> if CStr(CheckRegKey(sKey)) then
> set WshShell = CreateObject("WScript.Shell")
> WSHShell.Run strUninstallRMS6, 1 , FALSE
> end if
>
>
> Function CheckRegKey(sKey)
> On Error Resume next
> with CreateObject("WScript.Shell")
> .RegRead sKey
> end with
> CheckRegKey = (Err.Number = 0)
> On Error Goto 0
> end function
>
> --------------------------------------------------------------------------
>
> Ive tested the below and it definately works. i need the if statment
> to work.
>
> set WshShell = WScript.CreateObject("WScript.Shell")
> strUninstallRMS6 = "\\lbnfilr002\Packages\PkgsQ-T\RMS
> \RMS63\uninstallRMS6.bat"
>
> WSHShell.Run strUninstallRMS6, 1 , FALSE
> WScript.Quit
>
> PLease urgent help
>
> thanks

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Does this exist? Network & Sharing
How to do No hang up VBScript (nohup for VBScript) VB Script
vbscript registry exist then...... VB Script
Re: Does this exist? Live Mail
DNS Name does not exist Vista account administration


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