For Programmers: Free Programming Magazines  


Home > Archive > ASP > October 2006 > RE: Executing a Command using asp









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: Executing a Command using asp
Frankyt

2006-10-30, 6:58 pm


this may be a dumb question , but do your have sysinternals "psservice.exe"
available on a share on server1 called applist$\BobJCentralMS\ ?

if thats not it
you should look into using psexec to execute the sc start command (sc is
service controler). you can find all the info you need to start a service
with it via "sc /?"

also in windows forms there is a shell call called "shell(cmd as string,
appstyle as enum, wait as boolean, timout as integer )". I use it all the
time, but I don't know if it;s in ASP.

good luck

"Sh0t2bts" wrote:

> Hi,
>
> I am using the below command to restart a service on one of my web
> boxes, this runs fine from the command prompt and also through a *.bat
> file.
>
> " \\Server1\Applist$\BOBJCentralMS\psservi
ce.exe" \\Server2 -u
> eutee-ww02p\Username -p password restart BOBJCentralMS
>
>
>
> I found this asp code in this forum but can not get it to work with my
> command
> <%
> Dim oShell, sCommand
> sCommand = "MyCommand"
> Set oShell = CreateObject("WScript.Shell")
> oShell.Run sCommand, , True
> Set oShell = Nothing
> %>
>
> I replace "MYCommand" with the command i wish to execute but the page
> just hangs with the blue status bar halfway complete at the bottom,
> when checking the services on the box it is not restarted.
>
> Any Ideas
>
> Many Thanks
>
> Mark
>
>

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com