File.Exists does not work on some machines

  • Thread starter Thread starter Bas
  • Start date Start date
B

Bas

I'm using

If File.Exists("c:\docs\myfile.txt")
msgbox("Found")
End

This work fine on machine with Vb.Net installed but NOT on regular
workstations ie. when deployed!!

Any ideas?
 
Bas said:
This work fine on machine with Vb.Net installed but NOT on
regular workstations ie. when deployed!!

Any ideas?

To start with, you could tell us *exactly* what goes wrong when
it doesn't "work fine"!!!

What Exception (error message(s)) do you get?

Do your "regular workstations" have the .Net Framework installed?

Regards,
Phill W.
 
Dot net framework is installed (1.1)

The rest of the app works fine!
on both machines (ie. one with and one without vstudio)

There are no errors thrown - just behaves as though the file does not exist
 
Bas said:
I'm using

If File.Exists("c:\docs\myfile.txt")
msgbox("Found")
End

This work fine on machine with Vb.Net installed but NOT on regular
workstations ie. when deployed!!

Any ideas?

Just to get the silly and obvious questions out of the way:

1. Are you sure the file you are looking for exists on the deployed machine.

2. Does the process/application have read access to the folder? If it didn't
have read access then it might throw an exception - but I'm not sure so its
worth checking privileges.

hope this helps,

Brian.

www.cryer.co.uk/brian
 
Yes file exists!
(I even copied the whole folder from my Dev PC....to make sure)

At the moment I'm logged in as Administrator
This is a simple workstation "Standalone" in effect

Tried the app on 3 machines in the office (peer-peer setup)

My PC and Notebook BOTH have VStudio - work OK on both !

The rest of the app works on ALL machines!
although I'm having problems with Word and Excel objcets but thats another
story
(most likely I'm not disposing of all the objects I've created - which I
could close ALL the objects created in a Sub Routine at one!!)
 
Bas said:
Yes file exists!
(I even copied the whole folder from my Dev PC....to make sure)

At the moment I'm logged in as Administrator
This is a simple workstation "Standalone" in effect

Tried the app on 3 machines in the office (peer-peer setup)

My PC and Notebook BOTH have VStudio - work OK on both !

The rest of the app works on ALL machines!
although I'm having problems with Word and Excel objcets but thats another
story
(most likely I'm not disposing of all the objects I've created - which I
could close ALL the objects created in a Sub Routine at one!!)

Can I assume that this is a desktop vb application and not a web-based one?
I only ask because a web-based one will run within a different account than
the one you are logged in using.

The only other suggestion I have is that you download FileMon from
SystemInternals (http://www.sysinternals.com/Utilities/Filemon.html), run it
on the machine giving you problems and look and see what it thinks you are
doing. That will capture all reads and writes on your system, it should trap
the scan of the directory when doing the File.Exists("c:\docs\myfile.txt")
and might give an indication of any issues, so it might give you another
angle on the problem.

Other than that, I'm out of ideas.

Brian.

www.cryer.co.uk/brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top