Wscript.Shell run PRINT and NET PRINT returns nothing

S

Salty Dog

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?
 
R

Ray Costanzo [MVP]

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
 
S

Salty Dog

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?
 
R

Ray Costanzo [MVP]

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
 
S

Salty Dog

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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top