Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FileCopy Fails on Win2000, Works on XP

Status
Not open for further replies.
Jan 19, 2000
57
US
Hi!

I recently deployed a program that prints a file to a network-shared printer. It was written in VB.NET 2003. The program works fine on numerous Windows XP machines, but fails miserably on Windows 2000 machines.

I keep receiving error: System.IO.FileNotFoundException "\\mycompany\HP8150A"

Does Windows 2000 have a problem resolving UNC path names?

The code in question is pasted below.

Any help would be appreciated!

Thanks!

'Target file (printer) selected here
Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged
p = "\\mycompany\HP8150A"
Button4.Enabled = True
End Sub


'Source file selected. FileCopy performed to Target printer.
g = "H:\Projects\files\barcode.pcl"
Dim f11 As New System.IO.FileInfo(g)
If f11.Exists() Then
FileCopy(g, p)
Else
MsgBox("Missing File barcode.pcl!", vbOKOnly & vbExclamation, "Error")
Form1.ActiveForm.Focus()
End If
 
Dimandja - Thanks for the reply, but I'm not sure how it relates to my question.

Some more detail for my question. I can perform the copy from the windows command prompt with no problem. It is only the VB.NET program that is failing to perform the copy. The VB.NET program works wonderfully on XP, just not on Windows 2000.

Thanks in advance for any help on this issue!

- Mikeymac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top