Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 2nd, 2003, 03:54 PM
Authorized User
Points: 325, Level: 6
Points: 325, Level: 6 Points: 325, Level: 6 Points: 325, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Altamonte Springs, FL
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.
Reply With Quote
  #2 (permalink)  
Old December 4th, 2003, 09:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
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.
Reply With Quote
  #3 (permalink)  
Old December 4th, 2003, 10:40 AM
Authorized User
Points: 325, Level: 6
Points: 325, Level: 6 Points: 325, Level: 6 Points: 325, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Altamonte Springs, FL
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.

Reply With Quote
  #4 (permalink)  
Old December 4th, 2003, 11:33 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
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...
Reply With Quote
  #5 (permalink)  
Old December 4th, 2003, 11:53 AM
Authorized User
Points: 325, Level: 6
Points: 325, Level: 6 Points: 325, Level: 6 Points: 325, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Altamonte Springs, FL
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:)

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 07:02 PM.


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