itshibu 0 Newbie Poster

I tried to write a program that can open files from the server. But the shared folder in the Win2003 server is password protected. i tried the following code

System.Diagnostics.Process.Start("net.exe", "use K: \\Server\URI\path\here /USER:username password" )

Dim p = New System.Diagnostics.Process
p.Start("k:\" & Filename)

System.Diagnostics.Process.Start("net.exe", "use /delete K:" )

And it is working fine. But for big files and pdf files it opening and it is showing the File not found error. I know the problem is caused because the network drive deleting after opening the file. I tried to increase the delay to deletion of network drive. and somewhat success. except pdf file other files are working fine. PDF files still showing path not found after load all file also. I think it communicating the path after opening also. But some security reason I can't keep the network folder map.

So I wish to open the file in some otherway that can't bring any further problem.

Please help me in this matter. this is urgent.

Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.