473,783 Members | 2,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

File.Exists does not work on some machines

Bas
I'm using

If File.Exists("c: \docs\myfile.tx t")
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 4240
the framework.net must be installed on the client...
If File.Exists("c: \docs\myfile.tx t") then
msgbox("Found")
End if
???
--
Salute by the First Time!
"Bas" wrote:
I'm using

If File.Exists("c: \docs\myfile.tx t")
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******** ********@TK2MSF TNGP10.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******** ********@TK2MSF TNGP10.phx.gbl. ..
I'm using

If File.Exists("c: \docs\myfile.tx t")
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******** ********@TK2MSF TNGP10.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******** ********@TK2MSF TNGP10.phx.gbl. ..
I'm using

If File.Exists("c: \docs\myfile.tx t")
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******** ******@TK2MSFTN GP09.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.tx t")
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
4673
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 returned. Otherwise, a "Picture not found" path is returned. I have that part workin well. However, I have developed this on a local machine and want to push the class to my prosuction server. However, the paths change from machine to machine. I...
0
1470
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 against a cuttoff DateTime, and copies them if thet do not already exist. All progress is written to a log (a snippet is included below the code). The File.Exists() method returns false even when the file does in fact exist. Have I coded this...
7
3420
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 the same test scenario on a production box: no problems. Tried them on my developer box: no problems. In each of those two cases, the PC's were connected to the same test server and *supposedly* had the same production build image on them. ...
2
14409
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 states, "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."
6
10035
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 the client machine, the file type TIFF is associated with Kodak Imaging Preview. This app works on most client machines. When you click on the link, Kodak Imaging Preview will open the TIFF file on the client machine. However, on some machines, the...
10
3965
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, because I will call different work flow by check the status of
11
3824
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 doesn't seem to work. The code below is what I'm trying to use. Anyone see any obvious errors? or have any hints/pointers? regards, Igor float floatRead = 0;
5
17765
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 with the path "\\ 192.168.2.2\temp" (where temp is a shared directory on server \\192.168.2.2), windows prompts for a User Name and password of a user who has permission on that computer to access that directory. If I enter valid details, the...
0
9643
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7494
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.