473,382 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 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 1755

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 , msaccess hangs. The whole call to the procedure is...
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 that are directly on sys.path). If the script is...
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 "Module not found" error. This PEP aims to fix that...
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 application called GnuPG which allows us to encrypt 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 I would use stdlib.h by using a command such as...
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 Basic. The most obvious solution for me seemed to be...
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 Access template 'Order Entry' I have entered...
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 , msaccess hangs. The whole call to the procedure is...
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' The package works perfectly in enterprise...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.