 |
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 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
|
|
|

December 9th, 2003, 11:46 AM
|
Registered User
|
|
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|

December 9th, 2003, 12:23 PM
|
Registered User
|
|
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

December 11th, 2003, 11:55 AM
|
Registered User
|
|
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
nobody? :)
at least, could somebody say "it works for me!", so i know that my idea is ok?
|

December 11th, 2003, 01:01 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Here you go:
"it works for me!"
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|

December 11th, 2003, 01:04 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|

January 13th, 2004, 10:58 AM
|
Registered User
|
|
Join Date: Dec 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

June 9th, 2008, 01:35 AM
|
Registered User
|
|
Join Date: Jun 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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();
|
|
 |