By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,553 Members | 946 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,553 IT Pros & Developers. It's quick & easy.

File.Exists does not work on some machines

P: n/a
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?
Nov 21 '05 #1
Share this Question
Share on Google+
6 Replies

P: n/a
the framework.net must be installed on the client...
If File.Exists("c:\docs\myfile.txt") then
msgbox("Found")
End if
???
--
Salute by the First Time!
"Bas" wrote:
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?

Nov 21 '05 #2

P: n/a
"Bas" <Bas@microsoft_forums.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.
Nov 21 '05 #3

P: n/a
"Bas" <Bas@microsoft_forums.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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
Nov 21 '05 #4

P: n/a
Bas
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

"Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> wrote in message
news:dc**********@yarrow.open.ac.uk...
"Bas" <Bas@microsoft_forums.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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.

Nov 21 '05 #5

P: n/a
Bas
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!!)
"Brian Cryer" <br****@127.0.0.1.activesol.co.uk> wrote in message
news:11****************@lotis.uk.clara.net...
"Bas" <Bas@microsoft_forums.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
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

Nov 21 '05 #6

P: n/a
"Bas" <Bas@microsoft_forums.com> wrote in message
news:Oe**************@TK2MSFTNGP09.phx.gbl...
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

Nov 21 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.