none
AppData Folder

    Question

  • Ok guys i have made a few threads stating how i need to store data to the program files directory, but i couldnt becuase it required adminstrator privileges. After searching around i found an appdata folder with the path "C:\Users\Cristian Rivera\AppData\Local\VirtualStore\Program Files (x86)\Atari\RollerCoaster Tycoon 3 Platinum"

    The TrackedRideCars folder is at path C:\Users\Cristian Rivera\AppData\Local\VirtualStore\Program Files (x86)\Atari\RollerCoaster Tycoon 3 Platinum\Cars\TrackedRideCar     WHICH IS GREAT BECUASE I CAN PUT FOLDERS IN THEIR WITHOUT REQUIREING ADMIN RIGHTS

    The trackedRides folder is at path C:\Users\Cristian Rivera\AppData\Local\VirtualStore\Program Files (x86)\Atari\RollerCoaster Tycoon 3 Platinum\tracks\TrackedRides                               WHICH IS GREAT BECUASE I CAN PUT FOLDERS IN THEIR WITHOUT REQUIREING ADMIN RIGHTS

     

    My last problem right know is that i know how to download folders and i know how to search for folders but how can i download a folder into the above directories without knowing the name of the user account.

     

     

    Saturday, July 31, 2010 1:40 AM

Answers


  • I think you have more of a problem here than the username.  You are seeing "Program Files (x86)" because your machine is a 64 bit machine.  It "likely" will be the same path, except without the " (x86)" part on a 32 bit machine.
     
    If you are only worried about 64 bit machines, then the following code would give you the two paths that you need for the current user in the variables folder1 and folder2:
     
        Sub Main()
            Dim LS_Folder As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
            Dim RCT3P As String = Path.Combine(LS_Folder, "VirtualStore\Program Files (x86)\Atari\RollerCoaster Tycoon 3 Platinum")
            Dim folder1 As String = Path.Combine(RCT3P, "Cars\TrackedRideCar")
            Dim folder2 As String = Path.Combine(RCT3P, "tracks\TrackedRides ")
            Console.WriteLine(folder1)
            Console.WriteLine(folder2)
            Console.ReadKey()
        End Sub
     
    If you need to worry about 32/64 bit architecture, then I'm afraid I cannot help with that.

    --
    Mike
    Saturday, July 31, 2010 1:52 AM

All replies


  • I think you have more of a problem here than the username.  You are seeing "Program Files (x86)" because your machine is a 64 bit machine.  It "likely" will be the same path, except without the " (x86)" part on a 32 bit machine.
     
    If you are only worried about 64 bit machines, then the following code would give you the two paths that you need for the current user in the variables folder1 and folder2:
     
        Sub Main()
            Dim LS_Folder As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
            Dim RCT3P As String = Path.Combine(LS_Folder, "VirtualStore\Program Files (x86)\Atari\RollerCoaster Tycoon 3 Platinum")
            Dim folder1 As String = Path.Combine(RCT3P, "Cars\TrackedRideCar")
            Dim folder2 As String = Path.Combine(RCT3P, "tracks\TrackedRides ")
            Console.WriteLine(folder1)
            Console.WriteLine(folder2)
            Console.ReadKey()
        End Sub
     
    If you need to worry about 32/64 bit architecture, then I'm afraid I cannot help with that.

    --
    Mike
    Saturday, July 31, 2010 1:52 AM
  • i am trying to incorporate

    Function getOSPlatForm() As String
        Dim OsPlatForm As String = Nothing
        If IntPtr.Size * 8 = 32 Then
          OsPlatForm = "X86"
        Else
          OsPlatForm = "X64"
        End If
        Return OsPlatForm
      End Function
    
    but it thinks i have a 32 bit os

    Saturday, July 31, 2010 2:02 AM
  • Be aware that your data folder has nothing to do with X86 of X64, use for that the sample from Mike

     


    Success
    Cor
    Saturday, July 31, 2010 7:40 AM
  • but it thinks i have a 32 bit os


    "This works fine…but only if your application is compiled for “AnyCPU” as the target CPU .  If you compile your assembly with the target CPU “x86″, for example, IntPtr.Size will always be 4 bytes, regardless of the OS architecture."

    Above quoted from the following link.


    anti-social
    Sunday, August 01, 2010 2:07 AM
  • How do i compile it to anycpu
    Sunday, August 01, 2010 2:08 AM
  • Sunday, August 01, 2010 3:21 AM
  • thanks
    Sunday, August 01, 2010 3:25 AM