Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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?==========SCRIPT=========
sUser="DOMAIN\USER"
sPass="PASSWORD"&"{enter}"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
wscript.quit
==========END OF SCRIPT=========

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.
Stuart

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?

http://msdn.microsoft.com/en-us/lib...
http://windowsitpro.com/article/art...
"Best Practices", Event viewer, host file, perfmon, antivirus, anti-spyware, Live CD's, backups, are in my top 10

![]() |
VPN Port
|
help me
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |