Security [CENTRAL] Forum - SCforum.info
08. September 2010., 01:58:35 *
Welcome, Guest. Please login or register.

Login with username, password and session length

Custom Search
News:
 
  Home   Forum   Help Chess Links Login Register   *

SCforum.info




SCF Recent Posts
[07. September 2010., 16:06:32]

[07. September 2010., 15:54:04]

[07. September 2010., 05:42:21]

[07. September 2010., 05:28:16]

[07. September 2010., 05:12:04]

[06. September 2010., 18:38:01]

[06. September 2010., 17:00:09]

[06. September 2010., 10:44:42]

[05. September 2010., 07:40:42]

[05. September 2010., 07:28:29]
SCF Translate


Members
Total Members: 4836
Latest: boomer
Stats
Total Posts: 11009
Total Topics: 3375
Online Today: 1159
Online Ever: 51419
(01. January 2010., 10:27:49)
Users Online
Users: 11
Guests: 1294
Total: 1305

@MEMBER OF PROJECT HONEY POT
Spam Harvester Protection Network
provided by Unspam

Friend of WOT

Creative Commons License

SCF Feedburner

SCF Facebook

SCF Twitter

Welcome to SCforum.info - Security [CENTRAL] Forum, a home of the SCF Community devoted to provide Computer related News, Alerts, Downloads and FREE Help in such a way that even the novice computer user can understand.

Getting started using our community is extremely easy, check the two steps below:

Step 1: Create an account by clicking here. It's completely free with no hidden strings attached.

Step 2: If you have a computer problem and need some help, or just want to take part in opened discussions, simply visit: "FORUM". Once you *Register an account, you can quickly post your questions and comments.

(*Registered Members get: free support, also, they can communicate privately with other members via PM, removal of this message, see fewer ads and much more...)






Pages: 1
  Print  
Author Topic: Help with vbscript  (Read 612 times)
0 Members and 1 Guest are viewing this topic.
F3RL
SCF Advanced Member
***

KARMA: 15
Gender: Male
Location: Australia
Posts: 162



« on: 20. November 2009., 23:56:48 »

Hi,

I got this vbscript that clears system tray notification icons by deleting two registry entries.
The problem is I want to execute this when logging off but it displays two messages;
and I want someone to instruct me how to remove that message but continue executing the script.

here is the script;
------------------------------------------------------------------------------
Message = "To work correctly, the script will close" & vbCR
Message = Message & "and restart the Windows Explorer shell." & vbCR
Message = Message & "This will not harm your system." & vbCR & vbCR
Message = Message & "Continue?"

X = MsgBox(Message, vbYesNo, "Notice")

If X = 6 Then

On Error Resume Next

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\IconStreams"
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\PastIconsStream"

Set WshShell = Nothing

On Error GoTo 0

For Each Process in GetObject("winmgmts:"). _
   ExecQuery ("select * from Win32_Process where name='explorer.exe'")
   Process.terminate(0)
Next

MsgBox "Finished." & vbcr & vbcr & "© Doug Knox and Kelly Theriot", 4096, "Done"

Else

MsgBox "No changes were made to your system." & vbcr & vbcr & "© Doug Knox and Kelly Theriot", 4096, "User Cancelled"

End If
------------------------------------------------------------------------------

Can you help me remove the message popups?

Thank you in advance.
Logged

well? understand ma bad English.
Security [CENTRAL] Forum - SCforum.info
« on: 20. November 2009., 23:56:48 »



 Logged
hazedaze
SCF VIP Member
*****

KARMA: 15
Gender: Male
Age: 27
Location: Uk
Posts: 75



« Reply #1 on: 18. January 2010., 13:58:31 »

OMG I'm trying to rember my VB days at College!!!lol

If my thinking is correct can't you simply put "REM" at the begining of the Msgbox sentence,

Your Code for example Would Read:

Message = "To work correctly, the script will close" & vbCR
Message = Message & "and restart the Windows Explorer shell." & vbCR
Message = Message & "This will not harm your system." & vbCR & vbCR
Message = Message & "Continue?"

X = MsgBox(Message, vbYesNo, "Notice")

If X = 6 Then

On Error Resume Next

Set WshShell = WScript.CreateObject("WScript.Shell")

WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\IconStreams"
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\TrayNotify\PastIconsStream"

Set WshShell = Nothing

On Error GoTo 0

For Each Process in GetObject("winmgmts:"). _
   ExecQuery ("select * from Win32_Process where name='explorer.exe'")
   Process.terminate(0)
Next

Rem MsgBox "Finished." & vbcr & vbcr & "© Doug Knox and Kelly Theriot", 4096, "Done"

Else

Rem MsgBox "No changes were made to your system." & vbcr & vbcr & "© Doug Knox and Kelly Theriot", 4096, "User Cancelled"

End If
Logged
Pages: 1
  Print  
 
Jump to:  

Enter your email address to receive daily email with 'SCforum.info - Security CENTRAL Forum' newest content:

Terms of Use | Privacy Policy
Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!


Google visited last this page 20. August 2010., 05:55:57