472,353 Members | 1,184 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Executing a Command using asp

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\psservice.ex e" \\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

Aug 15 '06 #1
1 1706

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\psservice.ex e" \\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

Oct 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure ,...
0
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts...
15
by: Nick Coghlan | last post by:
Python 2.4's -m command line switch only works for modules directly on sys.path. Trying to use it with modules inside packages will fail with a...
18
by: Brad Pears | last post by:
Can someone give me some sample code on how one would go about executing a command line "command" from within an ASP form? We need to run an...
2
by: Erhan | last post by:
Hello, after a recent move to windows API from terminal I come across a small problem. How can I execute a program without using stdlib.h ? Before...
3
by: PzYon | last post by:
Hey 2gether! I'm trying to execute a PERL script on the web server when the user presses a button in an ASP.NET Web Application using Visual...
0
by: NOSPAM | last post by:
Guys, I get the 'There was an error executing the command' error message. I an using win xp & Access 2002. I created a database using the MS...
1
by: rvdw | last post by:
Hi All, I've a serious problem with executing stored procedures (SQL2000) from an Access db (version 97). After executing a stored procedure ,...
4
by: Justine | last post by:
Hi All, How can v execute DOS command while executing Console Application written using C#, like cls,dir commnads. Thanz in Advance, Justine
0
by: blueblueblue | last post by:
Hi, I am trying to execute my dts package from sql using command shell as exec master..xp_cmdshell 'dtsrun /Sfiutopiadb /Usa /P /NBulktest' ...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.