Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: vbs functions in hta?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: vbs functions in hta?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: vbs functions in hta? - 5/15/2007 5:54:47 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
That worked!  Thanks.

(in reply to dm_4ever)
 
 
Post #: 21
 
 RE: vbs functions in hta? - 5/16/2007 8:09:40 AM   
  mcds99


Posts: 441
Score: 4
Joined: 2/28/2006
Status: offline
Using WMIPing returns much faster then the Ping command using a run or exec.
I use the following in a ping sweep of a given group of IP addressses.
A status code is returned insted of the standard 3 pings that take a long time to complete.


      

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to ekrengel)
 
 
Post #: 22
 
 RE: vbs functions in hta? - 5/17/2007 12:04:54 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
Yeah thats what my ping function is when you see this part of my script:


      

The sleep sub uses the standard one...because thats the only way i've found for sleep to work.

(in reply to ekrengel)
 
 
Post #: 23
 
 RE: vbs functions in hta? - 5/18/2007 4:05:15 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
I'm getting a type mismatch error at the start of " window.moveTo intLeft, intTop"


      

(in reply to ekrengel)
 
 
Post #: 24
 
 RE: vbs functions in hta? - 5/18/2007 4:39:23 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
Nevermind, I found a code that works perfectly:


      

(in reply to ekrengel)
 
 
Post #: 25
 
 RE: vbs functions in hta? - 5/21/2007 2:51:08 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
I am finding 1 problem with this script...it seems that the cmd process is staying open....which seems to stop other shutdown commands after the first one.  Does anyone see anything wrong with this that would keep the cmd.exe process open? 

objShell.Run "%comspec% /K shutdown.exe -r -f -t " & strTime & " -c "& strMessage &" -m \\" & strComputer, 0

(in reply to ekrengel)
 
 
Post #: 26
 
 RE: vbs functions in hta? - 5/21/2007 3:01:35 AM   
  dm_4ever


Posts: 2724
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
What if you change you %comspec% /K to /c?

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to ekrengel)
 
 
Post #: 27
 
 RE: vbs functions in hta? - 5/21/2007 3:07:23 AM   
  ekrengel

 

Posts: 28
Score: 0
Joined: 5/11/2007
Status: offline
Doh!  Yup thats it, thanks.

(in reply to dm_4ever)
 
 
Post #: 28
 
 RE: vbs functions in hta? - 5/21/2007 4:04:58 AM   
  Rischip


Posts: 510
Score: 2
Joined: 3/26/2007
Status: offline
My reply is in response to the original post.

Wscript.Sleep does not work in HTA. Anything you use in an HTA to get around this will be a hack.

What I do is as follows.
-----External sleep.vbs file---------
Set WshShell = WScript.CreateObject("WScript.Shell")
Set args = wscript.arguments
Wscript.sleep (args(0)*1000)
-----End External sleep.vbs file---------

Then call the vbs from the HTA

Set oShell = CreateObject("WScript.Shell")
command =  "cscript " + Directory of the file + "\sleep.vbs " + " 1"(<- the number of seconds to sleep)
oShell.Run command, 0, True

_____________________________

Rischip
Author of - The Grim Linker

(in reply to ekrengel)
 
 
Post #: 29
 
 
Page:  <<   < prev  1 [2]
 
  

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 >> RE: vbs functions in hta? Page: <<   < prev  1 [2]
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