473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

1 minute delay to access Printer Share

Code:
<%Response.Buffer = False%>
<HTML>
<HEAD>
<title>Printing</title>
</HEAD>
<BODY>
<center>
<%
FilePath = "c:\WUTemp\441817810_receiver.txt"
'PrinterShare = "\\Garchive\ISLaser"
PrinterShare = "\\Meta3\OKIDATA"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(FilePath,1,True)
strReadAll = objFile.ReadAll
Set objFile = nothing

on error resume next

Set objFile = objFSO.CreateTextFile(PrinterShare)
objFile.write(strReadAll)
Set objFile = nothing

Set objFSO = nothing

Response.Write("Priting...<br><br>Please wait.")
'Response.Write(Err.number)
'Response.End
%>

<script language=javascript>
var Err = <%=Err.number%>;
if (Err != 0) {
self.setTimeout('window.location.reload();', 65000);
}
else{
window.close();
}
</script>

</BODY>
</HTML>

Here is the workaround that I'm using to try accessing the Printer share and
if error then wait 65 seconds and then it prints without error. Any ideas
what might cause this and how to avoid the 1 minute delay workaround? Thanks
in advance!

If I'm not doing something wrong, should this be a bug report?

Jul 22 '05 #1
6 2556
It's best to keep the current thread rather than posting a new message for
which we don't know what is the context and what others may have already
suggested...

Also what is the exact error ? For now I would say it waits before printing
because there is no formfeed character to tell you are done with the page...

Patrice

--

"Salty Dog" <Sa******@discussions.microsoft.com> a écrit dans le message de
news:60**********************************@microsof t.com...
Code:
<%Response.Buffer = False%>
<HTML>
<HEAD>
<title>Printing</title>
</HEAD>
<BODY>
<center>
<%
FilePath = "c:\WUTemp\441817810_receiver.txt"
'PrinterShare = "\\Garchive\ISLaser"
PrinterShare = "\\Meta3\OKIDATA"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(FilePath,1,True)
strReadAll = objFile.ReadAll
Set objFile = nothing

on error resume next

Set objFile = objFSO.CreateTextFile(PrinterShare)
objFile.write(strReadAll)
Set objFile = nothing

Set objFSO = nothing

Response.Write("Priting...<br><br>Please wait.")
'Response.Write(Err.number)
'Response.End
%>

<script language=javascript>
var Err = <%=Err.number%>;
if (Err != 0) {
self.setTimeout('window.location.reload();', 65000);
}
else{
window.close();
}
</script>

</BODY>
</HTML>

Here is the workaround that I'm using to try accessing the Printer share and if error then wait 65 seconds and then it prints without error. Any ideas
what might cause this and how to avoid the 1 minute delay workaround? Thanks in advance!

If I'm not doing something wrong, should this be a bug report?

Jul 22 '05 #2
Thanks for the single thread tip. I was beginning to notice that after
waiting a while for a response, I would get quick response to a new thread.
I'll try to be more patient.

The error is "Permission denied". Without any other changes but waiting
after the first attempt the code works. Also, this code did not require this
delay workaround until just recently. This makes me think that one of the
security updates changed the environment.

Any ideas? Thanks in advance!

"Salty Dog" wrote:
Code:
<%Response.Buffer = False%>
<HTML>
<HEAD>
<title>Printing</title>
</HEAD>
<BODY>
<center>
<%
FilePath = "c:\WUTemp\441817810_receiver.txt"
'PrinterShare = "\\Garchive\ISLaser"
PrinterShare = "\\Meta3\OKIDATA"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(FilePath,1,True)
strReadAll = objFile.ReadAll
Set objFile = nothing

on error resume next

Set objFile = objFSO.CreateTextFile(PrinterShare)
objFile.write(strReadAll)
Set objFile = nothing

Set objFSO = nothing

Response.Write("Priting...<br><br>Please wait.")
'Response.Write(Err.number)
'Response.End
%>

<script language=javascript>
var Err = <%=Err.number%>;
if (Err != 0) {
self.setTimeout('window.location.reload();', 65000);
}
else{
window.close();
}
</script>

</BODY>
</HTML>

Here is the workaround that I'm using to try accessing the Printer share and
if error then wait 65 seconds and then it prints without error. Any ideas
what might cause this and how to avoid the 1 minute delay workaround? Thanks
in advance!

If I'm not doing something wrong, should this be a bug report?

Jul 22 '05 #3
I would call fso.CopyFile <text file name>, <printer share name>. It is
simpler and also more likely to succeed.

Does that help?

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
Thanks for the single thread tip. I was beginning to notice that after
waiting a while for a response, I would get quick response to a new
thread.
I'll try to be more patient.

The error is "Permission denied". Without any other changes but waiting
after the first attempt the code works. Also, this code did not require
this
delay workaround until just recently. This makes me think that one of the
security updates changed the environment.

Any ideas? Thanks in advance!

"Salty Dog" wrote:
Code:
<%Response.Buffer = False%>
<HTML>
<HEAD>
<title>Printing</title>
</HEAD>
<BODY>
<center>
<%
FilePath = "c:\WUTemp\441817810_receiver.txt"
'PrinterShare = "\\Garchive\ISLaser"
PrinterShare = "\\Meta3\OKIDATA"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(FilePath,1,True)
strReadAll = objFile.ReadAll
Set objFile = nothing

on error resume next

Set objFile = objFSO.CreateTextFile(PrinterShare)
objFile.write(strReadAll)
Set objFile = nothing

Set objFSO = nothing

Response.Write("Priting...<br><br>Please wait.")
'Response.Write(Err.number)
'Response.End
%>

<script language=javascript>
var Err = <%=Err.number%>;
if (Err != 0) {
self.setTimeout('window.location.reload();', 65000);
}
else{
window.close();
}
</script>

</BODY>
</HTML>

Here is the workaround that I'm using to try accessing the Printer share
and
if error then wait 65 seconds and then it prints without error. Any
ideas
what might cause this and how to avoid the 1 minute delay workaround?
Thanks
in advance!

If I'm not doing something wrong, should this be a bug report?

Jul 22 '05 #4
Way simpler and I'll use this cool technique going forward but still errors
with error '800a0046' Permission denied. Dang, I thought you had it but not
quite!

"Paul Baker" wrote:
I would call fso.CopyFile <text file name>, <printer share name>. It is
simpler and also more likely to succeed.

Does that help?

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
Thanks for the single thread tip. I was beginning to notice that after
waiting a while for a response, I would get quick response to a new
thread.
I'll try to be more patient.

The error is "Permission denied". Without any other changes but waiting
after the first attempt the code works. Also, this code did not require
this
delay workaround until just recently. This makes me think that one of the
security updates changed the environment.

Any ideas? Thanks in advance!

"Salty Dog" wrote:
Code:
<%Response.Buffer = False%>
<HTML>
<HEAD>
<title>Printing</title>
</HEAD>
<BODY>
<center>
<%
FilePath = "c:\WUTemp\441817810_receiver.txt"
'PrinterShare = "\\Garchive\ISLaser"
PrinterShare = "\\Meta3\OKIDATA"

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile(FilePath,1,True)
strReadAll = objFile.ReadAll
Set objFile = nothing

on error resume next

Set objFile = objFSO.CreateTextFile(PrinterShare)
objFile.write(strReadAll)
Set objFile = nothing

Set objFSO = nothing

Response.Write("Priting...<br><br>Please wait.")
'Response.Write(Err.number)
'Response.End
%>

<script language=javascript>
var Err = <%=Err.number%>;
if (Err != 0) {
self.setTimeout('window.location.reload();', 65000);
}
else{
window.close();
}
</script>

</BODY>
</HTML>

Here is the workaround that I'm using to try accessing the Printer share
and
if error then wait 65 seconds and then it prints without error. Any
ideas
what might cause this and how to avoid the 1 minute delay workaround?
Thanks
in advance!

If I'm not doing something wrong, should this be a bug report?


Jul 22 '05 #5
This is running in an ASP?

You need to check the Directory Security settings on the IIS folder. Is the
user logging in as an anoymous IUSR or as a Windows user? You need to pay
attention to what they log in as. Remember that the browser can be
configured to automatically send credentials if challenged, so there may be
no logon dialog.

You need to check the permissions of the printer share.

Permission denied is permission denied. Check permissions.

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
Way simpler and I'll use this cool technique going forward but still
errors
with error '800a0046' Permission denied. Dang, I thought you had it but
not
quite!

"Paul Baker" wrote:
I would call fso.CopyFile <text file name>, <printer share name>. It is
simpler and also more likely to succeed.

Does that help?

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
> Thanks for the single thread tip. I was beginning to notice that after
> waiting a while for a response, I would get quick response to a new
> thread.
> I'll try to be more patient.
>
> The error is "Permission denied". Without any other changes but
> waiting
> after the first attempt the code works. Also, this code did not
> require
> this
> delay workaround until just recently. This makes me think that one of
> the
> security updates changed the environment.
>
> Any ideas? Thanks in advance!
>
> "Salty Dog" wrote:
>
>> Code:
>> <%Response.Buffer = False%>
>> <HTML>
>> <HEAD>
>> <title>Printing</title>
>> </HEAD>
>> <BODY>
>> <center>
>> <%
>> FilePath = "c:\WUTemp\441817810_receiver.txt"
>> 'PrinterShare = "\\Garchive\ISLaser"
>> PrinterShare = "\\Meta3\OKIDATA"
>>
>> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
>>
>> Set objFile = objFSO.OpenTextFile(FilePath,1,True)
>> strReadAll = objFile.ReadAll
>> Set objFile = nothing
>>
>> on error resume next
>>
>> Set objFile = objFSO.CreateTextFile(PrinterShare)
>> objFile.write(strReadAll)
>> Set objFile = nothing
>>
>> Set objFSO = nothing
>>
>> Response.Write("Priting...<br><br>Please wait.")
>> 'Response.Write(Err.number)
>> 'Response.End
>> %>
>>
>> <script language=javascript>
>> var Err = <%=Err.number%>;
>> if (Err != 0) {
>> self.setTimeout('window.location.reload();', 65000);
>> }
>> else{
>> window.close();
>> }
>> </script>
>>
>> </BODY>
>> </HTML>
>>
>> Here is the workaround that I'm using to try accessing the Printer
>> share
>> and
>> if error then wait 65 seconds and then it prints without error. Any
>> ideas
>> what might cause this and how to avoid the 1 minute delay workaround?
>> Thanks
>> in advance!
>>
>> If I'm not doing something wrong, should this be a bug report?
>>


Jul 22 '05 #6
Yes this is a webpage and the anonymous user is a domain admin at least
temporarily until I can get this to work without the delay and I'll tighten
security.
Keep in mind that this code will run without changes after waiting 1 minute.
That's the funky part... permission denied but after waiting 1 minute and
not changing anything, permission granted. That's where I'm thinking that
the permissions are configured properly or it would never succeed. What do
think is up with this some kind of delayed permissions??? Thanks so much for
your help!

"Paul Baker" wrote:
This is running in an ASP?

You need to check the Directory Security settings on the IIS folder. Is the
user logging in as an anoymous IUSR or as a Windows user? You need to pay
attention to what they log in as. Remember that the browser can be
configured to automatically send credentials if challenged, so there may be
no logon dialog.

You need to check the permissions of the printer share.

Permission denied is permission denied. Check permissions.

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:22**********************************@microsof t.com...
Way simpler and I'll use this cool technique going forward but still
errors
with error '800a0046' Permission denied. Dang, I thought you had it but
not
quite!

"Paul Baker" wrote:
I would call fso.CopyFile <text file name>, <printer share name>. It is
simpler and also more likely to succeed.

Does that help?

Paul

"Salty Dog" <Sa******@discussions.microsoft.com> wrote in message
news:B4**********************************@microsof t.com...
> Thanks for the single thread tip. I was beginning to notice that after
> waiting a while for a response, I would get quick response to a new
> thread.
> I'll try to be more patient.
>
> The error is "Permission denied". Without any other changes but
> waiting
> after the first attempt the code works. Also, this code did not
> require
> this
> delay workaround until just recently. This makes me think that one of
> the
> security updates changed the environment.
>
> Any ideas? Thanks in advance!
>
> "Salty Dog" wrote:
>
>> Code:
>> <%Response.Buffer = False%>
>> <HTML>
>> <HEAD>
>> <title>Printing</title>
>> </HEAD>
>> <BODY>
>> <center>
>> <%
>> FilePath = "c:\WUTemp\441817810_receiver.txt"
>> 'PrinterShare = "\\Garchive\ISLaser"
>> PrinterShare = "\\Meta3\OKIDATA"
>>
>> Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
>>
>> Set objFile = objFSO.OpenTextFile(FilePath,1,True)
>> strReadAll = objFile.ReadAll
>> Set objFile = nothing
>>
>> on error resume next
>>
>> Set objFile = objFSO.CreateTextFile(PrinterShare)
>> objFile.write(strReadAll)
>> Set objFile = nothing
>>
>> Set objFSO = nothing
>>
>> Response.Write("Priting...<br><br>Please wait.")
>> 'Response.Write(Err.number)
>> 'Response.End
>> %>
>>
>> <script language=javascript>
>> var Err = <%=Err.number%>;
>> if (Err != 0) {
>> self.setTimeout('window.location.reload();', 65000);
>> }
>> else{
>> window.close();
>> }
>> </script>
>>
>> </BODY>
>> </HTML>
>>
>> Here is the workaround that I'm using to try accessing the Printer
>> share
>> and
>> if error then wait 65 seconds and then it prints without error. Any
>> ideas
>> what might cause this and how to avoid the 1 minute delay workaround?
>> Thanks
>> in advance!
>>
>> If I'm not doing something wrong, should this be a bug report?
>>


Jul 22 '05 #7

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

Similar topics

12
by: Conrad | last post by:
Greetings, Q: Is there some way to gracefully suspend a python app for a second or so then resume? I could write the classic basic dumb loop-tenzillion-times delay, but that seems inelegant, and...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
64
by: John | last post by:
Hi What future does access have after the release of vs 2005/sql 2005? MS doesn't seem to have done anything major with access lately and presumably hoping that everyone migrates to vs/sql. ...
6
by: jdph40 | last post by:
We recently had to upgrade the computers in our company. Now our office's website on our company intranet no longer recognizes reports saved in snapshot format. We get an error message that the...
2
by: alan | last post by:
I'm now using vb.net to write a POS system with a epson thermal printer. I use the ocx that provided by Epson to drive the printer. It's not the problem if I just using 1 computer vs 1 thermal...
0
by: Ayman | last post by:
Hi How can I programmaticaly share my printer? I use NetShareAdd function, it returns NERR_Success. But, I face the following problems: 1. The share sign is not appeared on the printer 2. In...
0
by: kevin | last post by:
I need to connect to a shared printer on a LAN using .net code. I can connect to the printer by using explorer; search for the computer the share is on, then by click-clicking on the shared printer...
56
by: peng | last post by:
Hi, I am development a project using C#.Net. Inside application, it needs to print labels on different Zebra label printers on the network. I used a shell script, but it only worked on the...
1
by: lavender | last post by:
What are the command if I want to delay the 2nd output? what the header file I should use in C? example: Checking printer status.... (delay 3 seconds) Printer is offline. Please on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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
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,...

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.