Results 1 to 3 of 3

Thread: Appdata folder

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    8

    Question Appdata folder

    i have ben working on a kind of program installer, that shut move some files into the appdata folder, but i can't find the way its done:

    Code:
            If System.IO.Directory.Exists("C:\Test") Then
                System.IO.Directory.Move("C:\Test\", "%appdata%")
                MsgBox("Test installed!")
                System.IO.Directory.Delete("C:\Test\")
            Else
                MsgBox("Error: Test did not install correct!")
            End If
    but this just moves the folder to C:/Test/%appdata%/test

    how to make so it moves the the users appdata folder witch is found at: C:/users/LOCALUSER/Appdata

  2. #2
    Wait... what? weirddemon's Avatar
    Join Date
    Jan 2009
    Location
    USA
    Posts
    3,826

    Re: Appdata folder

    You never want to hard code the path.

    The local appdata folder can be obtained using:

    vb Code:
    1. Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
    CodeBank contributions: Process Manager, Temp File Cleaner

    Quote Originally Posted by SJWhiteley
    "game trainer" is the same as calling the act of robbing a bank "wealth redistribution"....

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2010
    Posts
    8

    Re: Appdata folder

    Thanks :d you made my day :d

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width