Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2003, 03:54 PM
Authorized User
 
Join Date: Aug 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default Execute command lines from ASP????

Hi:

Can I execute command lines from w/in ASP?

I tried this and it just locks up the browser.
In fact everything I tried either returned an integer, 1 into RetCode or just locked up the browser permanently:
Can I find out what error the integer represents?

Code:
Set WShShell = Server.CreateObject("WScript.Shell")
RetCode = WShShell.run("cmd cd c:\MRDBackup", ,False)
If RetCode = 0 Then
    sErr = "Install Created"
Else
    sErr = "ERROR: Install Not Created: " & RetCode
End If
__________________
http://www.softlinksys.com
Professional Software Developer since 1994.
 
Old December 4th, 2003, 09:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

does MRDBackup raise any prompts to the user? If it does, that will be the cause of the hang.
 
Old December 4th, 2003, 10:40 AM
Authorized User
 
Join Date: Aug 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No, it doesn't. It can return lines in DOS but it's got switch /V0 which I'm using which means verbose=none.

 
Old December 4th, 2003, 11:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

I'm at a loss then, I'm afraid. The return code of 1 is just whatever the command returns (if it doesn't have any specific exit codes for different errors, then it will just return 1 if it fails and 0 if it succeeds - not much help really).

You could try using the Exec method of the WshShell object instead, since that is specififcally designed for command-line programs, but I don't know if this will help coz Run should work just fine...
 
Old December 4th, 2003, 11:53 AM
Authorized User
 
Join Date: Aug 2003
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by pgtips
 I'm at a loss then, I'm afraid. The return code of 1 is just whatever the command returns (if it doesn't have any specific exit codes for different errors, then it will just return 1 if it fails and 0 if it succeeds - not much help really).

You could try using the Exec method of the WshShell object instead, since that is specififcally designed for command-line programs, but I don't know if this will help coz Run should work just fine...
Hmm, just my luck. Well, it's working through my VB component (go fig'r). It's an extra step but I guess I'll have to live with it.

Thanks for your help:)






Similar Threads
Thread Thread Starter Forum Replies Last Post
c# web service execute remote command? chintu926 .NET Web Services 1 May 24th, 2006 07:05 AM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM
execute external command in asp s80ts0465 Classic ASP Basics 4 August 3rd, 2004 01:55 PM
command object and objconn.execute... kyootepuffy Classic ASP Databases 1 October 3rd, 2003 02:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.