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

Discussion in 'ASP General' started by Bill, Jul 27, 2003.

  1. Bill

    Bill Guest

    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?
    Bill, Jul 27, 2003
    #1
    1. Advertising

  2. Bill

    Bill Guest

    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:Olqphy%...
    > 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" <> wrote in message
    > news:e59Dns%...
    > > > 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:...
    > > > 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" <> wrote in message
    > > > news:...
    > > > > 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?

    > >
    > >

    >
    >
    Bill, Jul 27, 2003
    #2
    1. Advertising

  3. Bill

    Ray at Guest

    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" <> wrote in message
    news:...
    > 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, Jul 27, 2003
    #3
  4. Bill

    Bill Guest

    > 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" <> wrote in message
    > news:...
    > > 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
    > >

    >
    >
    Bill, Jul 28, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Raúl Martín
    Replies:
    1
    Views:
    10,804
    Natty Gur
    May 13, 2004
  2. Kyle

    WScript.Shell Run Error

    Kyle, Jan 19, 2004, in forum: ASP General
    Replies:
    0
    Views:
    970
  3. Martin Danielson
    Replies:
    2
    Views:
    146
    Martin Danielson
    Feb 2, 2004
  4. ashish
    Replies:
    1
    Views:
    435
    ashish
    Aug 14, 2007
  5. Sagar

    Server.CreateObject Vs CreateObject

    Sagar, Jan 15, 2008, in forum: ASP General
    Replies:
    2
    Views:
    332
    Sagar
    Jan 15, 2008
Loading...

Share This Page