473,507 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wscript.Shell run PRINT and NET PRINT returns nothing

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?
Jul 22 '05 #1
4 9723
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" <Sa******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
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?

Jul 22 '05 #2
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" <Sa******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
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?


Jul 22 '05 #3
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" <Sa******@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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" <Sa******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
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?

Jul 22 '05 #4
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" <Sa******@discussions.microsoft.com> wrote in message
news:C8**********************************@microsof t.com...
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" <Sa******@discussions.microsoft.com> wrote in message
news:16**********************************@microsof t.com...
> 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?


Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
24123
by: Bill | last post by:
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...
0
7066
by: Kyle | last post by:
To any who chose to provide an answer, or even any suggestions to this problem, I thank you greatly in advance. +200 pts. for any valid solutions. I am currently in the process of converting a...
6
15604
by: MacKenzie | last post by:
The statement in an asp page: dim objShell Set objShell = WScript.CreateObject("WScript.Shell") now gives this error: VB err= 424,Object required If I use...
2
12174
by: rcmail14872 | last post by:
I have seen some very general suggestions for alternative code to the WScript.Shell code, but nothing specific. In the two lines of code below (I think) the first line creates a text file on the...
5
9164
by: Daniel Di Vita | last post by:
I am trying to run a command line from an ASP page. I am using windows 2003 with IIS6. I am able to get this to run on my local machine (Windows XP IIS5). Here is my code: jobNbr =...
0
2636
by: edurran | last post by:
Hi all, I have spent the last three days on this problem. Looked in many forums and not found the answer as yet. Hopefully ye can help. I have two functions. One works fine, the second does...
0
4592
by: AirYT | last post by:
Done a bunch of searching on this topic and i have come up with nothing. I have a .vbs script that i wish to execute by calling an asp page. i am working on a W2K server with IIS5.0 & SP4. ...
24
17397
by: mdfidahussain | last post by:
hello frnds, I have written a simple asp .net code in button click event, in which should run "xx.cmd" file when pressed (below is the code) Partial Class _Default Inherits...
2
10456
by: =?Utf-8?B?VG9kZA==?= | last post by:
Hello I'm using the following script to try and ping: <% Response.Buffer = true %> <% url = "www.espn.com" Set objWShell = CreateObject("WScript.Shell") Set objCmd = objWShell.Exec("ping " &...
0
7376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7485
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1542
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.