Reply
Wscript Shell for PSExec
Old 11-22-2007, 01:56 AM Wscript Shell for PSExec
Novice Talker

Posts: 5
Name: Lai Ying
Hi all expert here,

I meet a problem coding a ASP code to call a psexec here.
My code as below.

<%
Set oS = Server.CreateObject("WSCRIPT.SHELL")
output = oS.exec("cmd.exe /c psexec -s
\\dngew -i C:\RefComm.bat").stdout.readall
response.write output
response.write "<br> finish!"
%>


That is not working when I test with open using the this ASP page.
But if i just type purely the code as :

psexec -s \\dngew -i C:\RefComm.bat

in my DOS(cmd), it work properly.
That is no problem with my ASP code too, because if my code as

<%
Set oS = Server.CreateObject("WSCRIPT.SHELL")
output = oS.exec("cmd.exe /c ipconfig").stdout.readall
response.write output
response.write "<br> finish!"
%>


it working perfectly and return the result at the page.
Any idea with this? Even my senior also no idea about this.
Vivi is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 11-22-2007, 10:02 AM Re: Wscript Shell for PSExec
chrishirst's Avatar
Super Moderator

Posts: 11,865
Location: Blackpool. UK
ASP code runs on a server so if you are expecting that code to run something on your desktop you'll be out of luck.

Are you running it on localhost?

Are the SysInternals tools (including psexec) installed on the target machine?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-22-2007, 08:16 PM Re: Wscript Shell for PSExec
Novice Talker

Posts: 5
Name: Lai Ying
My situation is:

When a user browse this page and update something, the server will do something remotely into other PC machine.

The code should run at server, so server will remote(using psexec) to other PC to call a batch file.

Server already have psexec, and the batch file. Those PC (\\dngew) will remote by server also include psexec and batch file too.

Any idea?
Thanks!!~
Vivi is offline
Reply With Quote
View Public Profile
 
Old 11-23-2007, 06:14 AM Re: Wscript Shell for PSExec
chrishirst's Avatar
Super Moderator

Posts: 11,865
Location: Blackpool. UK
Have you looked at the Sysinternal Forum

Personally I've never used PSTools, ran Dameware when I was a system admin.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2007, 12:46 AM Re: Wscript Shell for PSExec
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,025
Name: Forrest Croce
Location: Seattle, WA
Does the user IIS is running under have permission to do all of this?
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 11-26-2007, 05:18 AM Re: Wscript Shell for PSExec
Novice Talker

Posts: 5
Name: Lai Ying
I think either is IIS or Psexec problem.
I did given full access for those psexec and batch file. but that is not working too.
Vivi is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Wscript Shell for PSExec
 

Thread Tools

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

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




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.13937 seconds with 13 queries