Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Wscript.Shell run PRINT and NET PRINT returns nothing

Reply
Thread Tools

Wscript.Shell run PRINT and NET PRINT returns nothing

 
 
Salty Dog
Guest
Posts: n/a
 
      02-28-2005
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?
 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      02-28-2005
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:16DFC1B1-FB7F-4514-82DD-...
> 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?



 
Reply With Quote
 
 
 
 
Salty Dog
Guest
Posts: n/a
 
      02-28-2005
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:16DFC1B1-FB7F-4514-82DD-...
> > 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?

>
>
>

 
Reply With Quote
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      02-28-2005
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:C8A35557-510E-4DFC-98D8-...
> 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:16DFC1B1-FB7F-4514-82DD-...
> > > 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?
> >
> >
> >



 
Reply With Quote
 
Salty Dog
Guest
Posts: n/a
 
      02-28-2005
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:C8A35557-510E-4DFC-98D8-...
> > 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:16DFC1B1-FB7F-4514-82DD-...
> > > > 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?
> > >
> > >
> > >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re module: Nothing to repeat, but no sre_constants.error: nothing torepeat ? Devin Jeanpierre Python 2 02-14-2012 01:33 PM
DataGrid.FindControl() returns nothing MattB ASP .Net 2 02-16-2005 04:47 AM
qry returns nothing (no data matched qry) Bob Green via .NET 247 ASP .Net 2 04-16-2004 08:54 AM
Query returns nothing Bijoy Naick ASP .Net 2 02-01-2004 07:16 PM
show running returns nothing, routing stops Richard Antony Burton Cisco 10 11-25-2003 10:39 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57