Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Quirky Script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,36762
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Quirky Script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Quirky Script - 8/7/2006 4:06:45 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
Ok so I wrote a script to decrypt all files and folders on a system provided it doesn't have a specfic application on the system. The scripts checks to see if the system is a laptop and if so it checks for the application. If the application is installed it will decrypt the system, otherwise it will encrypt the specified files and folders. Now when I run the script on a system that doesn't belong to our laptop users group it bombards the system with wscript.exe and cmd.exe processes. The error appears to happen in the FolderEncryption() sub where it runs the cipher command. I was wondering if anyone could determine what was causing this issue? Thanks for the help.



      
 
 
Post #: 1
 
 RE: Quirky Script - 8/7/2006 5:35:14 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
Just an FYI. It works fine if the script is run under CScript. But if it's run under WScript then it goes nuts. 

(in reply to Mindmesh)
 
 
Post #: 2
 
 RE: Quirky Script - 8/7/2006 5:50:49 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: offline
I haven't read the script itself, but you should be aware that WScript.Echo acts like MsgBox when the script is run with WScript. So anywhere in your script that you have WScript.Echo, the script will pop open a message box on the screen.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Mindmesh)
 
 
Post #: 3
 
 RE: Quirky Script - 8/7/2006 5:55:02 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
Yeah that wouldn't be so bad. I only use the wscript.echo for troubleshooting, but this is different. It's not a message box that's popping up it's like 300 cmd.exe boxes. Also, in task manager there are about 150 wscript.exe's. Not sure what would cause such a significant differnece between the two shells (Proper term???). 

(in reply to ebgreen)
 
 
Post #: 4
 
 RE: Quirky Script - 8/7/2006 7:13:11 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Well, I have found that if you use a Shell.Run command, and don't specify that you want it to wait until the command if compelte before moving on to the next line, it won't.
I modified your shell.run statements to wait for the process to close, so give this a try.


      


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to Mindmesh)
 
 
Post #: 5
 
 RE: Quirky Script - 8/8/2006 1:26:27 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
Run the script in a wrapper.

In a .cmd file put cscript scriptname.vbs
Create a short cut that runs minimized calling the .cmd file.

No more popup command prompts.

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to Mindmesh)
 
 
Post #: 6
 
 RE: Quirky Script - 8/8/2006 4:26:50 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
its much easier to just set cscript as your default script host


Tue 08/08/2006 @ 12:25:14.67 | kirrilian@workstation
C:\Documents and Settings\grhea.dis.000
=)cscript //H:cscript
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

The default script host is now set to "cscript.exe".

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to mcds99)
 
 
Post #: 7
 
 RE: Quirky Script - 8/22/2006 8:01:33 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
This worked like a charm thank you!!

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 8
 
 RE: Quirky Script - 8/22/2006 8:12:58 AM   
  Mindmesh

 

Posts: 78
Score: 0
Joined: 11/23/2004
From:
Status: offline
I was able to block the pop-ups with the Shell.run command.

Shell.run(<command>, 0)  The zero suppresses the command windows, supposedly.

(in reply to mcds99)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Quirky Script Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts