473,405 Members | 2,272 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,405 software developers and data experts.

File.Exists not working.

Now this is strange.
I had an app runing on W2K Pro and now that its on XP I cant find a file.

The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?



Jul 4 '06 #1
7 2287
"George Lake" <g@lake.comschrieb:
>I had an app runing on W2K Pro and now that its on XP I cant find a file.

The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?
Documentation:

| *Return Value*
| 'true' if the caller has the required permissions and 'path'
| contains the name of an existing file; otherwise, 'false'. This
| method also returns 'false' if 'path' is a null reference
| ('Nothing' in Visual Basic) or a zero-length string. If the
| caller does not have sufficient permissions to read the specified
| file, no exception is thrown and the method returns 'false'
| regardless of the existence of 'path'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jul 4 '06 #2
mmm
It should work then. The application is running under the same user as the
old server.
mmmm
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
"George Lake" <g@lake.comschrieb:
>>I had an app runing on W2K Pro and now that its on XP I cant find a file.

The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?

Documentation:

| *Return Value*
| 'true' if the caller has the required permissions and 'path'
| contains the name of an existing file; otherwise, 'false'. This
| method also returns 'false' if 'path' is a null reference
| ('Nothing' in Visual Basic) or a zero-length string. If the
| caller does not have sufficient permissions to read the specified
| file, no exception is thrown and the method returns 'false'
| regardless of the existence of 'path'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Jul 4 '06 #3
George Lake wrote:
>>I had an app runing on W2K Pro and now that its on XP I cant find a
file. The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?

Documentation:
>>*Return Value*
'true' if the caller has the required permissions and 'path'
contains the name of an existing file; otherwise, 'false'. This
It should work then. The application is running under the same user as
the old server.
You can use filemon from www.sysinternals.com to see if it is really trying
to do what you want.

Andrew
Jul 5 '06 #4

What user? If it is "system", then XP won't let the network IO succeed.
This is one of the security changes from W2K to XP.

Mike Ober.

"George Lake" <g@lake.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>
mmm
It should work then. The application is running under the same user as the
old server.
mmmm
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
"George Lake" <g@lake.comschrieb:
>I had an app runing on W2K Pro and now that its on XP I cant find a
file.
>
The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?
Documentation:

| *Return Value*
| 'true' if the caller has the required permissions and 'path'
| contains the name of an existing file; otherwise, 'false'. This
| method also returns 'false' if 'path' is a null reference
| ('Nothing' in Visual Basic) or a zero-length string. If the
| caller does not have sufficient permissions to read the specified
| file, no exception is thrown and the method returns 'false'
| regardless of the existence of 'path'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>




Jul 5 '06 #5
It´s a domain user that has admin rights on the target server.

"Michael D. Ober" <obermd.@.alum.mit.edu.nospamwrote in message
news:u%****************@TK2MSFTNGP04.phx.gbl...
>
What user? If it is "system", then XP won't let the network IO succeed.
This is one of the security changes from W2K to XP.

Mike Ober.

"George Lake" <g@lake.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>>
mmm
It should work then. The application is running under the same user as
the
old server.
mmmm
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:eo**************@TK2MSFTNGP04.phx.gbl...
"George Lake" <g@lake.comschrieb:
I had an app runing on W2K Pro and now that its on XP I cant find a
file.
>>
The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then

Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Any ideas why this is not working?

Documentation:

| *Return Value*
| 'true' if the caller has the required permissions and 'path'
| contains the name of an existing file; otherwise, 'false'. This
| method also returns 'false' if 'path' is a null reference
| ('Nothing' in Visual Basic) or a zero-length string. If the
| caller does not have sufficient permissions to read the specified
| file, no exception is thrown and the method returns 'false'
| regardless of the existence of 'path'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>





Jul 5 '06 #6
Does the user have the O drive mapped to the correct network share? Also,
can the user browse to that file manually and open it?
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
It´s a domain user that has admin rights on the target server.

"Michael D. Ober" <obermd.@.alum.mit.edu.nospamwrote in message
news:u%****************@TK2MSFTNGP04.phx.gbl...
>>>>I had an app runing on W2K Pro and now that its on XP I cant find
a
>
file.
>>>>The code that is not working is:
If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then
Where "O:\DTX Import UMAR\AsTester.txt" is a network path.

Jul 5 '06 #7
yes to both.
what beats me is that the same app runing under the same user works on win2k
Pro and not on XP pro

"Jim Wooley" <ji*************@hotmail.comwrote in message
news:24*************************@msnews.microsoft. com...
Does the user have the O drive mapped to the correct network share? Also,
can the user browse to that file manually and open it?
Jim Wooley
http://devauthority.com/blogs/jwooley/default.aspx
>It´s a domain user that has admin rights on the target server.

"Michael D. Ober" <obermd.@.alum.mit.edu.nospamwrote in message
news:u%****************@TK2MSFTNGP04.phx.gbl...
>>>>>I had an app runing on W2K Pro and now that its on XP I cant find
>a
>>
file.

>The code that is not working is:
>If File.Exists("O:\DTX Import UMAR\AsTester.txt") Then
>Where "O:\DTX Import UMAR\AsTester.txt" is a network path.


Jul 5 '06 #8

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

Similar topics

0
by: Epson Barnett | last post by:
I have a C# Web application I'm working on that loads a csv file on application start. The csv is an inventory file which is used to create a collection in the Application object. If the collection...
5
by: matt dittman | last post by:
I have created a windows service that reads emails from a drop directory and moves them to the appropriate mail folder every 15 seconds. I can move, rename and delete the files as needed, up...
3
by: StGo | last post by:
How can i read/write file's custom attributs(like subject,author...) in C#??? Thanks :))
2
by: Zeno Lee | last post by:
I'm using File.Exists to test a file on my C: drive. My program was strongly named and had caspol -af run on it to allow it to run from the network. There are 3 ways I am doing this: 1) Run...
2
by: hecsan07 | last post by:
I am a true new comer in C#, and I haven't done much with files. I am trying to open a file for input, but I don't know how to check if the file exists first. I have a pretty crappy book that's...
6
by: Chad Crowder | last post by:
Getting the following error on my production server whether the file exists or not: "System.IO.IOException: Cannot create a file when that file already exists." Here's the code generating the...
13
by: DC Gringo | last post by:
How do I test for existence of a file in the file system: If FileExists(myVariable & ".pdf") = True pnlMyPanel.Visible = True End If -- _____ DC G
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
6
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error...
17
by: Peter Duniho | last post by:
I searched using Google, on the web and in the newsgroups, and found nothing on this topic. Hopefully that means I just don't understand what I'm supposed to be doing here. :) The problem: ...
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: 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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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
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,...
0
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...

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.