File.Exists does not work on some machines

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bas

    File.Exists does not work on some machines

    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?


  • Rothariger

    #2
    RE: File.Exists does not work on some machines

    the framework.net must be installed on the client...
    [color=blue]
    > If File.Exists("c: \docs\myfile.tx t") then
    > msgbox("Found")
    > End if[/color]

    ???
    --
    Salute by the First Time!


    "Bas" wrote:
    [color=blue]
    > 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?
    >
    >
    >[/color]

    Comment

    • Phill.  W

      #3
      Re: File.Exists does not work on some machines

      "Bas" <Bas@microsoft_ forums.com> wrote in message
      news:%23P3hAH3k FHA.2660@TK2MSF TNGP10.phx.gbl. ..[color=blue]
      > This work fine on machine with Vb.Net installed but NOT on
      > regular workstations ie. when deployed!![/color]

      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.


      Comment

      • Brian Cryer

        #4
        Re: File.Exists does not work on some machines

        "Bas" <Bas@microsoft_ forums.com> wrote in message
        news:%23P3hAH3k FHA.2660@TK2MSF TNGP10.phx.gbl. ..[color=blue]
        > 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?[/color]

        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.

        Brian Cryer's home page, a collection of notes on my professional and personal interests. Including C#, VB.Net, Windows, DB admin, Delphi and more.



        Comment

        • Bas

          #5
          Re: File.Exists does not work on some machines

          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:dcalvi$rv8 $1@yarrow.open. ac.uk...[color=blue]
          > "Bas" <Bas@microsoft_ forums.com> wrote in message
          > news:%23P3hAH3k FHA.2660@TK2MSF TNGP10.phx.gbl. ..[color=green]
          > > This work fine on machine with Vb.Net installed but NOT on
          > > regular workstations ie. when deployed!![/color]
          >
          > 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.
          >
          >[/color]


          Comment

          • Bas

            #6
            Re: File.Exists does not work on some machines

            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" <brianc@127.0.0 .1.activesol.co .uk> wrote in message
            news:1122560323 .10782.0@lotis. uk.clara.net...[color=blue]
            > "Bas" <Bas@microsoft_ forums.com> wrote in message
            > news:%23P3hAH3k FHA.2660@TK2MSF TNGP10.phx.gbl. ..[color=green]
            > > 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?[/color]
            >
            > 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[/color]
            machine.[color=blue]
            >
            > 2. Does the process/application have read access to the folder? If it[/color]
            didn't[color=blue]
            > have read access then it might throw an exception - but I'm not sure so[/color]
            its[color=blue]
            > worth checking privileges.
            >
            > hope this helps,
            >
            > Brian.
            >
            > www.cryer.co.uk/brian
            >
            >[/color]


            Comment

            • Brian Cryer

              #7
              Re: File.Exists does not work on some machines

              "Bas" <Bas@microsoft_ forums.com> wrote in message
              news:OenI2I4kFH A.3288@TK2MSFTN GP09.phx.gbl...[color=blue]
              > 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!!)[/color]

              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.

              Brian Cryer's home page, a collection of notes on my professional and personal interests. Including C#, VB.Net, Windows, DB admin, Delphi and more.




              Comment

              Working...