Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Wscript.shell  Run Command Not Work Prope
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Wscript.shell Run Command Not Work Prope

 Post Reply Post Reply Page  12>
Author
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Topic: Wscript.shell Run Command Not Work Prope
    Posted: 26 April 2004 at 3:49am

Hello

this is a problem on running dos applications
i am use this code for disconnecting users from RAS i run file manualy in Dos window and work properly but this folowing code run without error but dosnot work .after running asp page nothing happend and no changes to ts.txt but Using dos window it changed and have command resault inside. why ??

<%
ServerName = Request.ServerVariables("SERVER_NAME")
Set Shell = Server.CreateObject("Wscript.Shell")

  strKilluser = Server.MapPath("Kill.exe")
  strKilluser = strKilluser & " 127.0.0.1 meteor >> d:\etacpp\debug\ts.txt"
  response.write(strkillUser & "<BR>")
  Shell.Run strKilluser
set Shell = Nothing
%>

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 26 April 2004 at 5:27pm
did you double check the parameters for your program?
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2004 at 3:03am

i cant understand your post . but when i test it manually in command shel it work . the resault returned by Run is Zero as Follow:

The Res Var have 0 value at End .

<%
ServerName = Request.ServerVariables("SERVER_NAME")
Set Shell = Server.CreateObject("Wscript.Shell")

  strKilluser = Server.MapPath("Kill.exe")
  strKilluser = strKilluser & " 127.0.0.1 meteor"
  strKilluser = strKilluser &" >> d:\etacpp\debug\ts.txt"

'This Following tow lines is For test:
  res = shell.Run ("%comspec% dir /c/k >> d:\etacpp\debug\ts.txt")
  response.write(res & "<BR>")

  res = Shell.Run (strKilluser)
  response.write(res & "<BR>")

  response.write(strkillUser & "<BR>")
set Shell = Nothing
%>

Last resault is :

0
0
D:\Etacpp\debug\Kill.exe 127.0.0.1 meteor >> d:\etacpp\debug\ts.txt

and nothing was added to ts.txt file..... its very important to me

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
Coco Brown View Drop Down
Senior Member
Senior Member
Avatar

Joined: 26 April 2002
Location: United States
Status: Offline
Points: 245
Post Options Post Options   Thanks (0) Thanks(0)   Quote Coco Brown Quote  Post ReplyReply Direct Link To This Post Posted: 03 May 2004 at 1:06pm

You can't use wscript.shell with ASP.

Try creating a component that makes the call, register it, and have your ASP script call that when you need it.

Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2004 at 3:03pm

First:
Why I Cant use Wscript.shell ??

Second:
Can U tell Me More ? Or Is there Any Free Component For Excuting Progs In Windows???

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
dpyers View Drop Down
Senior Member
Senior Member


Joined: 12 May 2003
Status: Offline
Points: 3937
Post Options Post Options   Thanks (0) Thanks(0)   Quote dpyers Quote  Post ReplyReply Direct Link To This Post Posted: 05 May 2004 at 3:27pm
Originally posted by Coco Brown Coco Brown wrote:

You can't use wscript.shell with ASP.

Try creating a component that makes the call, register it, and have your ASP script call that when you need it.


Sure you can use it. You have to have permission to execute it which isn't often granted on shared hosting, but you can run it from asp on your own machine. I use it to run some .bat  files that ping some  things.
Server Objects also has ASPExec - a free component that does pretty much the same thing.

I'd look at a permissions problem. Asp usually runs as I_USR, not as admin. If he's doing a killuser, the script will have to run as admin which means screwing around in iis on his machine. Error logs on the machine may show something.


Lead me not into temptation... I know the short cut, follow me.
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Posted: 08 May 2004 at 6:55am

Hi

All Files Have Permission To Iuser_serverName But Why I dosnt Get Any Error And Why My Test Lines Dos not Work (even If Kill.exe need Permission)
'This Following tow lines is For test:

  res = shell.Run ("%comspec% dir /c/k >> d:\etacpp\debug\ts.txt")
  response.write(res & "<BR>")

Sincerely

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
meteor View Drop Down
Groupie
Groupie
Avatar

Joined: 31 August 2003
Location: Iran
Status: Offline
Points: 67
Post Options Post Options   Thanks (0) Thanks(0)   Quote meteor Quote  Post ReplyReply Direct Link To This Post Posted: 14 May 2004 at 7:34am

Hello
WOW ::::..
my computer is P1(pentium one) with 64 MB ram .. i run windows 2K advanced server . for debugging this problem i pressed alt+ctrl+del and turned to task manager and then Processes then i request for this page  WOW i can see killuser.exe in the tasks for about half of second but no resault ws returned by .. Why?

 

Sincerely
--------------------
PowerFull Scripts For NTTacPlus
Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.