Loging to Remote Server & running a VB Script

August 3, 2009 at 11:26:16
Specs: Windows XP
Hi, I am trying to accomplish the following:
I am tryint to stop a web site on a remote server by using a VBscript.
I would like to run the STOPWEB.VBS command on the remote server and I cant seem to be able to.
(See below)
Can someone HELP ME?


set WshShell = CreateObject("WScript.Shell")

strCmd ="run \\webserver\c$\inetpub\adminscripts\stopweb.vbs -a 1"
rc=WshShell.Run("runas /user:" & sUser & " " & CHR(34) & strCmd & CHR(34) ,1,False)
Wscript.Sleep 1000 'need to give time for window to open.
WshShell.AppActivate("runas.exe") 'make sure we grab the right window to send password to'
WshShell.SendKeys sPass 'send the password to the waiting window.'

set WshShell=Nothing

==========END OF SCRIPT=========

See More: Loging to Remote Server & running a VB Script

Report •

August 3, 2009 at 12:40:16
Who owns this server? If it is not you the chances are the the owner as disalbed the ability to run VB scripts. Besides, unless the service is running under Windows VB scripts are not going to work.


Report •

August 3, 2009 at 12:58:30
I am trying to have a user run the script and the script has the Admin and Password of the remote server.
can I do this with a batch file instead?

Report •

August 3, 2009 at 14:09:10


"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10

Report •

Related Solutions

Ask Question