Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Components Discussions specific to components in ASP 3.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Components 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 9th, 2003, 11:46 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with WScript.Shell object

hello, guys,

i need help with WScript.Shell. I wrote the following code on my page:

<%
Set o = Server.CreateObject("WScript.Shell")
o.Run("d:\users\my\DosApplication.exe")
Set o = Nothing
%>

and my application never executes! If i make changes and write:

o.Run("c:\winnt\notepad.exe")

everything works just fine (of course i can't see the window, but i see it in task manager)!

what should i do? any ideas?

kornjaca
  #2 (permalink)  
Old December 9th, 2003, 12:23 PM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Some more info on my question:

I usualy run my ASP application in High (isolated) mode on IIS, so i guess it's being run under IWAM_MYMACHINE account. But I also tried running it inprocess with IIS, so it should've run under SYSTEM account (I managed to make notepad to run under SYSTEM account), so I guess it's probably NOT a security setting problem.

I'm trying to run it on Win2k server with SP4.

thanks.

  #3 (permalink)  
Old December 11th, 2003, 11:55 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

nobody? :)

at least, could somebody say "it works for me!", so i know that my idea is ok?

  #4 (permalink)  
Old December 11th, 2003, 01:01 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Here you go:

"it works for me!"

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #5 (permalink)  
Old December 11th, 2003, 01:04 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Just kidding.

I think you have your own "works for me" Notepad runs, so your exe should also run.

What exactly does the .exe do? Did you create it yourself? Does it access the registry, files or other resources it needs permissions for?

Or maybe it's one of those Run and Close executables that close when they're finished. When you run them from a Command Prompt you may not realize that. What happens when you run the exe by double clicking it?

Alternatively, create a short cut to the exe, right click the new shortcut and choose Run As. Log in as the account with limited permissions and see if it works.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #6 (permalink)  
Old January 13th, 2004, 10:58 AM
Registered User
 
Join Date: Dec 2003
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

i still haven't managed to make it work, but i found a workaround, in case anybody is interested.

it's a piece of code in ASP.NET:

using System.Diagnostics;

Process procMyExe;
ProcessStartInfo procInfo;

procInfo = new ProcessStartInfo(@"c:\temp\myapp.exe");
procInfo.UseShellExecute = false;
procInfo.WorkingDirectory = @"c:\temp\";

try
{
  procMyExe = Process.Start(procInfo);
}
catch (Exception ex)
{
  // bla truc kenj
}

and that's about it. and it works. the only requirement is ASP.NET.

  #7 (permalink)  
Old June 9th, 2008, 01:35 AM
Registered User
 
Join Date: Jun 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have put the same code (with some changes) in OnStart Event of a service created through aWindows Service prject, it is not working.

Process procMyExe;

procInfo.StartInfo.FileName = "powercfg.exe";
procInfo.StartInfo.Arguments="/create customScheme"
procInfo.UseShellExecute = false;
procInfo.Start();

 


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
Please help me in WScript.Shell scripting shahhussain Classic ASP Professional 3 October 3rd, 2006 03:11 PM
Error in WScript.CreateObject pankaj.talk Pro VB.NET 2002/2003 1 June 5th, 2006 03:34 PM
Wscript.echo - How to change font size?? warewulf Beginning VB 6 0 December 27th, 2005 07:20 PM
WScript RTC Classic ASP Basics 2 June 8th, 2005 04:03 AM
Wscript Permissions Problem orph351 Classic ASP Components 0 September 4th, 2003 03:25 PM



All times are GMT -4. The time now is 03:09 PM.


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