473,387 Members | 1,534 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,387 software developers and data experts.

File.Exists does not work on some machines

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
6 4225
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
"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
"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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Hugh McLaughlin | last post by:
Hello Everyone and thanks for your help in advance. I am working on an application that uses as helper class to determine if an image file exists. If the file exists, the path to the image is...
0
by: Tim Richardson | last post by:
I am attempting to copy some files from one machine to another. I am having difficulty with the File.Exists() in the code below. The program enumerates the files in a directory, checks them...
7
by: (Pete Cresswell) | last post by:
We were testing a version of our app that's been running for months with no problems and it started throwing "Object no longer exists" messages on two machines in the test environment. We tried...
2
by: Chris Fink | last post by:
I am using the System.IO.File class to determine if a file exists on a network share. The File.Exists method keeps returning false, even though the file does exist. The MSDN documentation...
6
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On...
10
by: Julia | last post by:
Hi, there, I am trying to append a binary file by using: FILE *strean; stream = fopen( "c:\temp.dat", "ba+" )); Is there a way that I can check if the file exists or not before fopen,...
11
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
5
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.