Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



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

Posts: 5
Name: Lai Ying
Trades: 0
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
 
 
Register now for full access!
Old 11-22-2007, 11:02 AM Re: Wscript Shell for PSExec
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,515
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-22-2007, 09:16 PM Re: Wscript Shell for PSExec
Novice Talker

Posts: 5
Name: Lai Ying
Trades: 0
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, 07:14 AM Re: Wscript Shell for PSExec
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,515
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
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!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-26-2007, 01:46 AM Re: Wscript Shell for PSExec
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
Does the user IIS is running under have permission to do all of this?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Old 11-26-2007, 06:18 AM Re: Wscript Shell for PSExec
Novice Talker

Posts: 5
Name: Lai Ying
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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 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.44431 seconds with 12 queries