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
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: 14 May 2004 at 8:13am

It might be a problem with ths scope of sio. Try redirecting the output from the shell - something like

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


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: 15 June 2004 at 5:43am

Hello .
this is old Topic but I have problem Exist.
i tried to Debug Problem As this ways
First :
Kill.exe When You Pass it hostName and User ID it Will Kill User From RAS
Like : Kill.exe 127.0.0.1 Cafe123
1- i run Command(CMD) from Run Menu and inside it Tried This
 d:\wwwroot\Kill.exe 127.0.0.1 Cafe20
 and resault(output) is Like This
  cafe10
  cafe13
  Cafe16
  New23
  cafe20 -x-
  ...
Then This User Was Disconnected From Ras
if User Dos not Exist Above list Will show but Without -x-
this is Good .
now I try this
d:\wwwroot\kill.exe 127.0.0.1 cafe20 >> d:\wwwroot\kill.txt
bomb... this File Created and Have above Resault inside
now i exit Command env....
in My Script i tried This :


Set Shell = Server.CreateObject("Wscript.Shell")
Shell.Run "CMD /c Dir c:\ >> d:\wwwroot\kill.txt"

Resault is OK and List Of Drive c:\ is in the File
then i tried this Folow Codes But no Resault Except an Empty kill.txt File
(The File Kill.txt was Created But Empty)

Set Shell = Server.CreateObject("Wscript.Shell")
  strKilluser = Server.MapPath("execute\Kill.exe")
  strKilluser = "CMD /c "&strKilluser & " 127.0.0.1 " & user &" >> d:\wwwroot\kill.txt"
  Shell.Run strKilluser

And This Changed Lines


strKillUser = "CMD /c d:\wwwroot\kill.exe 127.0.0.1 test >> d:\wwwroot\kill.txt"


strKillUser ="CMD /c ""d:\wwwroot\kill.exe 127.0.0.1 test >> d:\wwwroot\kill.txt"""

After Each Test I Deleted Kill.txt File To Ensure Command Run Status
The Resault : Kill.txt File Was Created But is Empty Yet
(in Command Prompt i tried this : c:\>CMD /c DIR >> tst.txt  (OK) )

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.