Wscript.Shell run PRINT and NET PRINT returns nothing

Discussion in 'ASP General' started by Salty Dog, Feb 28, 2005.

  1. Salty Dog

    Salty Dog Guest

    No error or any feedback that I can work with.
    Code:
    set objShell = Server.CreateObject("WScript.Shell")

    objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
    >c:\WUTemp\Printer_Status1.txt", 0, True

    objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser c:\WUTemp\test.txt",
    0, True

    Set objShell = nothing

    I can run these commands successfully from the command-prompt on the server
    but from an ASP page, I get nothing not even an error. The Text output for
    NET PRINT is a blank text file.

    I feel something is different on the permissions side because this
    code/approach use to work fine.

    Thanks in advance for any help. Would a DCOM setting be applicable here?
     
    Salty Dog, Feb 28, 2005
    #1
    1. Advertising

  2. I'd imagine there's a good chance that your IUSR account doesn't have share
    permissions to that printer on your network. Does that printer share
    require domain authentication? If so, your local IUSR account will not be
    able to connect to it.

    While this doesn't focus on printing specifically, the same logic would
    apply here: http://www.aspfaq.com/show.asp?id=2168 (If the file is within
    your LAN section)

    Ray at work



    "Salty Dog" <> wrote in message
    news:...
    > No error or any feedback that I can work with.
    > Code:
    > set objShell = Server.CreateObject("WScript.Shell")
    >
    > objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
    > >c:\WUTemp\Printer_Status1.txt", 0, True

    > objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser

    c:\WUTemp\test.txt",
    > 0, True
    >
    > Set objShell = nothing
    >
    > I can run these commands successfully from the command-prompt on the

    server
    > but from an ASP page, I get nothing not even an error. The Text output

    for
    > NET PRINT is a blank text file.
    >
    > I feel something is different on the permissions side because this
    > code/approach use to work fine.
    >
    > Thanks in advance for any help. Would a DCOM setting be applicable here?
     
    Ray Costanzo [MVP], Feb 28, 2005
    #2
    1. Advertising

  3. Salty Dog

    Salty Dog Guest

    I've had the anonymous user as a domain admin in an effort to open things up.
    Still no error and no response/print.

    I was able to access the file using FileSystemObject via ASP.
    Any other ideas?

    "Ray Costanzo [MVP]" wrote:

    > I'd imagine there's a good chance that your IUSR account doesn't have share
    > permissions to that printer on your network. Does that printer share
    > require domain authentication? If so, your local IUSR account will not be
    > able to connect to it.
    >
    > While this doesn't focus on printing specifically, the same logic would
    > apply here: http://www.aspfaq.com/show.asp?id=2168 (If the file is within
    > your LAN section)
    >
    > Ray at work
    >
    >
    >
    > "Salty Dog" <> wrote in message
    > news:...
    > > No error or any feedback that I can work with.
    > > Code:
    > > set objShell = Server.CreateObject("WScript.Shell")
    > >
    > > objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
    > > >c:\WUTemp\Printer_Status1.txt", 0, True

    > > objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser

    > c:\WUTemp\test.txt",
    > > 0, True
    > >
    > > Set objShell = nothing
    > >
    > > I can run these commands successfully from the command-prompt on the

    > server
    > > but from an ASP page, I get nothing not even an error. The Text output

    > for
    > > NET PRINT is a blank text file.
    > >
    > > I feel something is different on the permissions side because this
    > > code/approach use to work fine.
    > >
    > > Thanks in advance for any help. Would a DCOM setting be applicable here?

    >
    >
    >
     
    Salty Dog, Feb 28, 2005
    #3
  4. How did you make a local account a domain admin? Regardless, you can access
    the remote file system? Alright, try this:

    net use lpt1: \\Garchive\ISLaser
    copy c:\WUTemp\test.txt lpt1
    net use lpt1: /d

    Also make sure that your IUSR has permissions to net.exe, and the C:\WUTemp
    directory.

    Ray at work




    "Salty Dog" <> wrote in message
    news:...
    > I've had the anonymous user as a domain admin in an effort to open things

    up.
    > Still no error and no response/print.
    >
    > I was able to access the file using FileSystemObject via ASP.
    > Any other ideas?
    >
    > "Ray Costanzo [MVP]" wrote:
    >
    > > I'd imagine there's a good chance that your IUSR account doesn't have

    share
    > > permissions to that printer on your network. Does that printer share
    > > require domain authentication? If so, your local IUSR account will not

    be
    > > able to connect to it.
    > >
    > > While this doesn't focus on printing specifically, the same logic would
    > > apply here: http://www.aspfaq.com/show.asp?id=2168 (If the file is

    within
    > > your LAN section)
    > >
    > > Ray at work
    > >
    > >
    > >
    > > "Salty Dog" <> wrote in message
    > > news:...
    > > > No error or any feedback that I can work with.
    > > > Code:
    > > > set objShell = Server.CreateObject("WScript.Shell")
    > > >
    > > > objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
    > > > >c:\WUTemp\Printer_Status1.txt", 0, True
    > > > objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser

    > > c:\WUTemp\test.txt",
    > > > 0, True
    > > >
    > > > Set objShell = nothing
    > > >
    > > > I can run these commands successfully from the command-prompt on the

    > > server
    > > > but from an ASP page, I get nothing not even an error. The Text

    output
    > > for
    > > > NET PRINT is a blank text file.
    > > >
    > > > I feel something is different on the permissions side because this
    > > > code/approach use to work fine.
    > > >
    > > > Thanks in advance for any help. Would a DCOM setting be applicable

    here?
    > >
    > >
    > >
     
    Ray Costanzo [MVP], Feb 28, 2005
    #4
  5. Salty Dog

    Salty Dog Guest

    I get error '80070002' on the copy line


    Also I tried:
    Set objFilePrint = objFSO.CreateTextFile("\\Garchive\ISLaser",True)
    and got a "Permission Denied" error.

    My anonymous user is assigned to a separate Domain Administrator account
    (not IUSR).

    I now have several code options to print the text file that work at the
    command-prompt but not in ASP. It appears to be a permissions issue in ASP
    but my authenticated user has permisssions. I made IWAM a temporary member
    of the local administrator's group for testing. There seems to be another
    step in the process that I'm unaware of that prevents permission. It reminds
    me of needing to assign the launch identitiy in DCOM but I'm not clear as to
    which application this would be.

    i appreciate your help!


    "Ray Costanzo [MVP]" wrote:

    > How did you make a local account a domain admin? Regardless, you can access
    > the remote file system? Alright, try this:
    >
    > net use lpt1: \\Garchive\ISLaser
    > copy c:\WUTemp\test.txt lpt1
    > net use lpt1: /d
    >
    > Also make sure that your IUSR has permissions to net.exe, and the C:\WUTemp
    > directory.
    >
    > Ray at work
    >
    >
    >
    >
    > "Salty Dog" <> wrote in message
    > news:...
    > > I've had the anonymous user as a domain admin in an effort to open things

    > up.
    > > Still no error and no response/print.
    > >
    > > I was able to access the file using FileSystemObject via ASP.
    > > Any other ideas?
    > >
    > > "Ray Costanzo [MVP]" wrote:
    > >
    > > > I'd imagine there's a good chance that your IUSR account doesn't have

    > share
    > > > permissions to that printer on your network. Does that printer share
    > > > require domain authentication? If so, your local IUSR account will not

    > be
    > > > able to connect to it.
    > > >
    > > > While this doesn't focus on printing specifically, the same logic would
    > > > apply here: http://www.aspfaq.com/show.asp?id=2168 (If the file is

    > within
    > > > your LAN section)
    > > >
    > > > Ray at work
    > > >
    > > >
    > > >
    > > > "Salty Dog" <> wrote in message
    > > > news:...
    > > > > No error or any feedback that I can work with.
    > > > > Code:
    > > > > set objShell = Server.CreateObject("WScript.Shell")
    > > > >
    > > > > objShell.Run "%comspec% /c NET PRINT \\Garchive\ISLaser
    > > > > >c:\WUTemp\Printer_Status1.txt", 0, True
    > > > > objShell.Run "%comspec% /c PRINT /d:\\Garchive\ISLaser
    > > > c:\WUTemp\test.txt",
    > > > > 0, True
    > > > >
    > > > > Set objShell = nothing
    > > > >
    > > > > I can run these commands successfully from the command-prompt on the
    > > > server
    > > > > but from an ASP page, I get nothing not even an error. The Text

    > output
    > > > for
    > > > > NET PRINT is a blank text file.
    > > > >
    > > > > I feel something is different on the permissions side because this
    > > > > code/approach use to work fine.
    > > > >
    > > > > Thanks in advance for any help. Would a DCOM setting be applicable

    > here?
    > > >
    > > >
    > > >

    >
    >
    >
     
    Salty Dog, Feb 28, 2005
    #5
    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. Bill
    Replies:
    3
    Views:
    690
  2. Kyle

    WScript.Shell Run Error

    Kyle, Jan 19, 2004, in forum: ASP General
    Replies:
    0
    Views:
    1,019
  3. Martin Danielson
    Replies:
    2
    Views:
    170
    Martin Danielson
    Feb 2, 2004
  4. Aayush Dubey
    Replies:
    0
    Views:
    559
    Aayush Dubey
    Aug 13, 2004
  5. Daniel Di Vita

    Wscript.Shell.run returns 254

    Daniel Di Vita, Apr 6, 2006, in forum: ASP General
    Replies:
    5
    Views:
    279
    Anthony Jones
    Apr 7, 2006
Loading...

Share This Page