What am I doing wrong??

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

    What am I doing wrong??

    Here is what I am trying:

    My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
    \Application Data", _
    "C:\Documen ts and Settings\" & Environment.Use rName & "\Applicati on
    Data\Adobe", True)
    MessageBox.Show ("Done Resetting Application Data, Press OK to
    Continue and reset Local Settings data", "Backup in progress...",
    MessageBoxButto ns.OKCancel, MessageBoxIcon. Information)
    My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
    \Local Settings", _
    "C:\Documen ts and Settings\" & Environment.Use rName & "\Local Settings
    \Application Data\Adobe", True)
    MessageBox.Show ("Done Resetting Local Settings data, Press OK
    to Continue.", "Backup in progress...", MessageBoxButto ns.OK,
    MessageBoxIcon. Information)

    I get the error that: \\server\all\se ts\Application Data is not
    found, but it is there, and inside that folder I want to copy a folder
    to c:\doc and set\user\applic ation data\adobe

    Also, will this work like this, one statement after another to do two
    things?

    thanks
  • Family Tree Mike

    #2
    Re: What am I doing wrong??

    But yoru code refers to \\server\all\se ts\!!!!!PREFS\A pplication Data.

    "Jason" <paul814@excite .comwrote in message
    news:3d11ea61-3a18-469e-b155-4be97f6f0fa4@n3 3g2000pri.googl egroups.com...
    Here is what I am trying:
    >
    My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
    \Application Data", _
    "C:\Documen ts and Settings\" & Environment.Use rName & "\Applicati on
    Data\Adobe", True)
    >
    <Snip/>
    >
    I get the error that: \\server\all\se ts\Application Data is not
    found, but it is there, and inside that folder I want to copy a folder
    to c:\doc and set\user\applic ation data\adobe
    >

    Comment

    • James Hahn

      #3
      Re: What am I doing wrong??

      It appears that "\\server\all\s ets\Application Data" is a folder. The
      message is probably saying something like "File does not exist :
      \\server\all\se ts\Application Data, which is correct, as there is no such
      file.

      You can't use FileSystem.Copy File to copy a folder - use CopyDirectory
      instead.

      Extending statements over multiple lines works, but can be avoided by
      setting a variable to the folder/file names first and using the variable
      instead of a literal in the statement. This makes your code much easier to
      develop and test. You can alsways get rid of the extra variables after
      everything is working OK.

      "Jason" <paul814@excite .comwrote in message
      news:3d11ea61-3a18-469e-b155-4be97f6f0fa4@n3 3g2000pri.googl egroups.com...
      Here is what I am trying:
      >
      My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
      \Application Data", _
      "C:\Documen ts and Settings\" & Environment.Use rName & "\Applicati on
      Data\Adobe", True)
      MessageBox.Show ("Done Resetting Application Data, Press OK to
      Continue and reset Local Settings data", "Backup in progress...",
      MessageBoxButto ns.OKCancel, MessageBoxIcon. Information)
      My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
      \Local Settings", _
      "C:\Documen ts and Settings\" & Environment.Use rName & "\Local Settings
      \Application Data\Adobe", True)
      MessageBox.Show ("Done Resetting Local Settings data, Press OK
      to Continue.", "Backup in progress...", MessageBoxButto ns.OK,
      MessageBoxIcon. Information)
      >
      I get the error that: \\server\all\se ts\Application Data is not
      found, but it is there, and inside that folder I want to copy a folder
      to c:\doc and set\user\applic ation data\adobe
      >
      Also, will this work like this, one statement after another to do two
      things?
      >
      thanks

      Comment

      • Jason

        #4
        Re: What am I doing wrong??

        What?

        On Sep 18, 7:01 pm, "Family Tree Mike"
        <FamilyTreeM... @ThisOldHouse.c omwrote:
        But yoru code refers to \\server\all\se ts\!!!!!PREFS\A pplication Data.
        >
        "Jason" <paul...@excite .comwrote in message
        >
        news:3d11ea61-3a18-469e-b155-4be97f6f0fa4@n3 3g2000pri.googl egroups.com...
        >
        Here is what I am trying:
        >
        My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
        \Application Data", _
        "C:\Documen ts and Settings\" & Environment.Use rName & "\Applicati on
        Data\Adobe", True)
        >
        <Snip/>
        >
        I get the error that: \\server\all\se ts\Application Data  is not
        found, but it is there, and inside that folder I want to copy a folder
        to c:\doc and set\user\applic ation data\adobe

        Comment

        • Family Tree Mike

          #5
          Re: What am I doing wrong??

          The code in your message has extra stuff "!!!!!PREFS " in the path. I'm
          trying to
          clarify whether you pasted wrong, or whether you overlooked the obvious.

          "Jason" <paul814@excite .comwrote in message
          news:a7bc89d6-f5fa-4ba1-887a-4eb9346c8f01@m4 4g2000hsc.googl egroups.com...
          What?

          On Sep 18, 7:01 pm, "Family Tree Mike"
          <FamilyTreeM... @ThisOldHouse.c omwrote:
          But yoru code refers to \\server\all\se ts\!!!!!PREFS\A pplication Data.
          >
          "Jason" <paul...@excite .comwrote in message
          >
          news:3d11ea61-3a18-469e-b155-4be97f6f0fa4@n3 3g2000pri.googl egroups.com...
          >
          Here is what I am trying:
          >
          My.Computer.Fil eSystem.CopyFil e("\\server\all \sets\!!!!!PREF S
          \Application Data", _
          "C:\Documen ts and Settings\" & Environment.Use rName & "\Applicati on
          Data\Adobe", True)
          >
          <Snip/>
          >
          I get the error that: \\server\all\se ts\Application Data is not
          found, but it is there, and inside that folder I want to copy a folder
          to c:\doc and set\user\applic ation data\adobe

          Comment

          Working...