468,765 Members | 1,067 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

server.createObject("wscript.shell") ... wShell.run ... stopped working...

I used to be able to run the following ASP code on our corp machine (W2K
Server Edition and IIS-5)
and successfully send a net-msg to anyone on our intranet.

Last week it stopped working... and I'm not sure what changed.
(I had applied ALL the W2K update patches... but... I'm not sure if the
problem started before or after that.)

Did any recent W2K patches change the way createObject, wScript.shell, or
"NET SEND" works?
(All my other ASP files continue to work fine.)

1> Dim wShell
2> response.write "Message Sent"
3> set wShell = server.createObject("wscript.shell")
4> wShell.run "Net SEND x.x.x.x test" ' (Insert the IP address
here)
5> set wShell = nothing

I can type "NET SEND" from the server "by hand" from a DOS prompt... and the
msg goes out fine.

When I try to use that same code to run NotePad.exe or Calc.exe... they
never open... but the Task Manager "process list" shows they are running.

Any ideas?

Jul 19 '05 #1
5 23637
When I run NET SEND from my asp code... the output file contains:
An error occurred while sending a message to x.x.x.x (And I do NOT get the pop-up.)

When I run the same NET SEND myself... from a DOS prompt on the server...
the output file contains: The message was successfully sent to x.x.x.x (And I do get the pop-up.)

When I run DIR from my asp code... the output file contains the correct
directory listing.

Hmmmm. Very interesting.

Does my ASP code work on your machine?

-Bill
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Ol****************@TK2MSFTNGP09.phx.gbl... Try running the net send with cmd.exe and piping the output, i.e.

wShell.Run "cmd.exe /c net send x.x.x.x
test>C:\PathOnServerThatIUSRhasWritePermissionsTo\ netsend.txt"

Then look at that file. It will either say "The message was successfully
sent to x.x.x.x." or something else indicating something, hopefully.

Ray at home

--
Will trade ASP help for SQL Server help
" Bill" <Bi****************@eMail.com> wrote in message
news:e5****************@TK2MSFTNGP11.phx.gbl...
it's based on the permissions of the IIS user account that you
selected
in
the IIS manager...

I've looked... but I'm not sure what I should set it to.
(I've never changed it... my ASP code just stopped working 1 day. It worked
100% fine for many months.)
Oh... and GUI apps (like notepad/calc/etc) will almost NEVER work from

ASP...

Would the fact that they *ARE* (at least) being executed...
at least tell me that I have my permissions set correctly?
(Each time I run my asp code... another copy of Calc.exe appears in the
process list.
Would that be happening if the user didn't have privileges to execute the ASP... or run executable?)

Does anyone know if any of the newest 20 "patches" to W2K changed some
"permission stuff"?

I DO appreciate your help with this.

Thanks

"Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
it's based on the permissions of the IIS user account that you
selected in the IIS manager...
Check there

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
..Offering free scripts & code snippits for everyone...
---------------------------------------------------------

" Bill" <Bi****************@eMail.com> wrote in message
news:OT**************@TK2MSFTNGP09.phx.gbl...
> I used to be able to run the following ASP code on our corp machine (W2K > Server Edition and IIS-5)
> and successfully send a net-msg to anyone on our intranet.
>
> Last week it stopped working... and I'm not sure what changed.
> (I had applied ALL the W2K update patches... but... I'm not sure if the > problem started before or after that.)
>
> Did any recent W2K patches change the way createObject,
wScript.shell, or
> "NET SEND" works?
> (All my other ASP files continue to work fine.)
>
> 1> Dim wShell
> 2> response.write "Message Sent"
> 3> set wShell = server.createObject("wscript.shell")
> 4> wShell.run "Net SEND x.x.x.x test" ' (Insert the IP

address > here)
> 5> set wShell = nothing
>
> I can type "NET SEND" from the server "by hand" from a DOS prompt... and the
> msg goes out fine.
>
> When I try to use that same code to run NotePad.exe or Calc.exe... they > never open... but the Task Manager "process list" shows they are

running.
>
> Any ideas?



Jul 19 '05 #2
permissions?
Change the permissions of the user that IIS is running under

--
----------------------------------------------------------
Curt Christianson (Software_AT_Darkfalz.Com)
Owner/Lead Designer, DF-Software
http://www.Darkfalz.com
---------------------------------------------------------
...Offering free scripts & code snippits for everyone...
---------------------------------------------------------

" Bill" <Bi****************@eMail.com> wrote in message
news:ee*************@tk2msftngp13.phx.gbl...
When I run NET SEND from my asp code... the output file contains:
An error occurred while sending a message to x.x.x.x

(And I do NOT get the pop-up.)

When I run the same NET SEND myself... from a DOS prompt on the server...
the output file contains:
The message was successfully sent to x.x.x.x

(And I do get the pop-up.)

When I run DIR from my asp code... the output file contains the correct
directory listing.

Hmmmm. Very interesting.

Does my ASP code work on your machine?

-Bill
"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:Ol****************@TK2MSFTNGP09.phx.gbl...
Try running the net send with cmd.exe and piping the output, i.e.

wShell.Run "cmd.exe /c net send x.x.x.x
test>C:\PathOnServerThatIUSRhasWritePermissionsTo\ netsend.txt"

Then look at that file. It will either say "The message was successfully
sent to x.x.x.x." or something else indicating something, hopefully.

Ray at home

--
Will trade ASP help for SQL Server help
" Bill" <Bi****************@eMail.com> wrote in message
news:e5****************@TK2MSFTNGP11.phx.gbl...
> it's based on the permissions of the IIS user account that you selected
in
the IIS manager...

I've looked... but I'm not sure what I should set it to.
(I've never changed it... my ASP code just stopped working 1 day. It

worked
100% fine for many months.)

> Oh... and GUI apps (like notepad/calc/etc) will almost NEVER work from ASP...

Would the fact that they *ARE* (at least) being executed...
at least tell me that I have my permissions set correctly?
(Each time I run my asp code... another copy of Calc.exe appears in the process list.
Would that be happening if the user didn't have privileges to execute

the ASP... or run executable?)

Does anyone know if any of the newest 20 "patches" to W2K changed some
"permission stuff"?

I DO appreciate your help with this.

Thanks

"Curt_C [MVP]" <Software_AT_Darkfalz.com> wrote in message
news:uk**************@TK2MSFTNGP11.phx.gbl...
> it's based on the permissions of the IIS user account that you selected
in
> the IIS manager...
> Check there
>
> --
> ----------------------------------------------------------
> Curt Christianson (Software_AT_Darkfalz.Com)
> Owner/Lead Designer, DF-Software
> http://www.Darkfalz.com
> ---------------------------------------------------------
> ..Offering free scripts & code snippits for everyone...
> ---------------------------------------------------------
>
> " Bill" <Bi****************@eMail.com> wrote in message
> news:OT**************@TK2MSFTNGP09.phx.gbl...
> > I used to be able to run the following ASP code on our corp

machine (W2K
> > Server Edition and IIS-5)
> > and successfully send a net-msg to anyone on our intranet.
> >
> > Last week it stopped working... and I'm not sure what changed.
> > (I had applied ALL the W2K update patches... but... I'm not sure
if the
> > problem started before or after that.)
> >
> > Did any recent W2K patches change the way createObject, wScript.shell, or
> > "NET SEND" works?
> > (All my other ASP files continue to work fine.)
> >
> > 1> Dim wShell
> > 2> response.write "Message Sent"
> > 3> set wShell = server.createObject("wscript.shell")
> > 4> wShell.run "Net SEND x.x.x.x test" ' (Insert the IP

address
> > here)
> > 5> set wShell = nothing
> >
> > I can type "NET SEND" from the server "by hand" from a DOS

prompt... and
> the
> > msg goes out fine.
> >
> > When I try to use that same code to run NotePad.exe or Calc.exe...

they
> > never open... but the Task Manager "process list" shows they are
running.
> >
> > Any ideas?



Jul 19 '05 #3
Are you sure that x.x.x.x is correct in your ASP page? Typically you'll get
that "an error occurred..." when the recipient cannot be resolved or does
not have the messenger service running. Your ASP code works fine on my W2K
server.

But I think that you should listen to Curt who has suggested a bunch of
times that it's probably a permissions thing. I don't know about your
setup, but on my W2K server, everyone has read/execute permissions, which is
fine, but on my XP machine, IUSR has explicit denied rights, and I don't
believe I set it that way.

Ray at home

--
Will trade ASP help for SQL Server help
" Bill" <Bi****************@eMail.com> wrote in message
news:ee*************@tk2msftngp13.phx.gbl...
When I run NET SEND from my asp code... the output file contains:
An error occurred while sending a message to x.x.x.x

(And I do NOT get the pop-up.)

When I run the same NET SEND myself... from a DOS prompt on the server...
the output file contains:
The message was successfully sent to x.x.x.x

(And I do get the pop-up.)

When I run DIR from my asp code... the output file contains the correct
directory listing.

Hmmmm. Very interesting.

Does my ASP code work on your machine?

-Bill

Jul 19 '05 #4
> Are you sure that x.x.x.x is correct in your ASP page?

The same IP address works when I type it in myself at a DOS prompt on the
server.
The same IP address does NOT work from the ASP code.
But I think that you should listen to Curt who has suggested a bunch of
times that it's probably a permissions thing.
I'll play with it some more.

Could it still be "wrong permission setting" when:
... the NET SEND executable *IS* definitely being executed. (And giving
its error msg.)
... NotePad.exe and Calc.exe *ARE* being executed. (And appearing in
the process list as "running".)
... "Dir >c:\tmp\dir.txt" works 100% fine. (And lists the files.)

Wouldn't *NONE* of that work... if it was a "you don't have permission"
thing?
(Instead... all of those work.)

Aren't computers fun?

-Bill

I don't know about your
setup, but on my W2K server, everyone has read/execute permissions, which is fine, but on my XP machine, IUSR has explicit denied rights, and I don't
believe I set it that way.

Ray at home

--
Will trade ASP help for SQL Server help
" Bill" <Bi****************@eMail.com> wrote in message
news:ee*************@tk2msftngp13.phx.gbl...
When I run NET SEND from my asp code... the output file contains:
An error occurred while sending a message to x.x.x.x

(And I do NOT get the pop-up.)

When I run the same NET SEND myself... from a DOS prompt on the server... the output file contains:
The message was successfully sent to x.x.x.x

(And I do get the pop-up.)

When I run DIR from my asp code... the output file contains the correct
directory listing.

Hmmmm. Very interesting.

Does my ASP code work on your machine?

-Bill


Jul 19 '05 #5
On Sun, 27 Jul 2003 23:40:28 -0400, "Ray at <%=sLocation%>"
<myfirstname at lane34 dot com> wrote:
Computers are very fun. I'd be curious to know what the rest of the net
send result was in the net send x.x.x.x test>C:\file.txt. Is it possible
your server's behind a firewall with port 135 (I think) blocked or
something?

Ray at home


If the net send port was blocked, he wouldn't be able to net send from
a command prompt.

I would try turning "Anonymous Access" OFF and integrated windows
security ON on the security tab of the page in question and see if
running the "net send" as YOU instead of IUSR_machine works.
Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Amjad | last post: by
1 post views Thread by Dennis | last post: by
4 posts views Thread by =?Utf-8?B?QWxoYW1icmEgRWlkb3MgS2lxdWVuZXQ=?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.