A better way to get location AppData?

To comply better with Vista, I took to the recovery of the location "AppData" in registry to determine a safe place for my application write files. The code I am using is like this:

ERR = RegReadString (REGKEY_HKCU, "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell records", "AppData", appdatapath, PATHLEN, & keysize);

Basically, it works but I have had a few reports it does not - where the AppData registry entry is corrupted or invalid.  How that is I have no idea.

But I'm intrigued by a key to this place on my Vista machine. The key is!. Do not use this registry key', and the value is "use the SHGetFolderPath or SHGetKnownFolderPath function.  It looks like a very good idea!

Can anyone tell me if these SDK functions will solve my problem, or how they may differ from a plain reading of the registry string?  Anyone here use them?

Thank you

Ian

Hello Ian,

I don't really know why this registry location works sometimes but not others, but Microsoft wants certainly we use the function and not in the registry.

Note that SHGetKnownFolderPath is too recent to be included in the version of the Windows SDK that comes with the ICB, but you can certainly use SHGetFolderPath that works as well in Vista and XP/2000:

#include
...

char path [MAX_PATHNAME_LEN];

SHGetFolderPath (0, CSIDL_COMMON_APPDATA, NULL, SHGFP_TYPE_CURRENT, path);

(you will need to add shell32.lib to your project CVI).

CSIDL_COMMON_APPDATA gives you the commune, "all users" folder If you want the folder of each user, you can use CSIDL_APPDATA.

Luis

Tags: NI Software

Similar Questions

  • A better way to get all the text style ranges in a table

    I am trying to get all the text varies from the style of my document into one. I'm scripting in JavaScript, which I'm not very familiar with, so maybe that's the problem.

    This is what, in my view, should work:

    app.activeDocument.stories.everyItem().textStyleRanges
    

    The above doesn't give me a text string, not an array of objects of text style than I expected. If I were using Applescript I would ask just for the beaches of text style object reference, but it is not a property that I found in the javascript object model.

    So I resorted to what is slower, but gives me what I want:

    var allStyleRanges = new Array();
    for (var g = 0; g < myStories.length; g++) {
      var storyStyleRanges = (myStories[g].textStyleRanges);
      for (var s = 0; s < storyStyleRanges.length; s++) {
      allStyleRanges.push(storyStyleRanges[s]);
      };
    };
    

    Does anyone have a better way?

    Lev,

    May it as your requirment...

    alert(app.activeDocument.stories.everyItem().textStyleRanges.everyItem().getElements())
    

    Concerning

    Siraj

  • Try to install adobe reader & I continue to get this message... Error 1606. Could access the location %APPDATA%\ network what do I do?

    Try to install adobe reader & I continue to get this message... Error 1606. Could access the location %APPDATA%\ network what do I do?

    Check the registry values listed in the present statutes are suitable:

    http://support.Microsoft.com/kb/886549

    http://support.Microsoft.com/kb/2258121

    If this does not resolve the problem, create a new administrator account and use it to do the installation.

    http://Windows.Microsoft.com/en-us/Windows-Vista/create-a-user-account

  • Impossible to download programs, get the error could not access network location %APPDATA%\protector.exe

    Help, please

    I am trying to download the new version of Microsoft Messenger and get up then stop downloading and I gat the message - could access the network % APPDATA%\.--aussi location, I get the same message when trying to domnload i tunes.  CAN ANYONE HELP PLEASE.

    Hi, Neil,.

    FixIt - You receive an "Error 1606" error message when you try to install or remove a program from Microsoft

    http://support.Microsoft.com/kb/886549

    You can also try to create a new user account.  Retry - the same problem occurs in the new account?  If this isn't the case, you have a corrupted profile.

    Difficulty of a corrupted user profile

    http://Windows.Microsoft.com/en-us/Windows-Vista/fix-a-corrupted-user-profile

    Error 1606: Could not access network location %APPDATA%\protector.exe

    http://forums.techarena.in/operating-systems/1127524.htm

  • Try to upgrade to the new version of Java and get error 1606: could not access network location %APPDATA%\protector.exe

    I tried the upgrade to the new version of JAVA kept b/c getting reminders... uninstall the older versions (2)... réessayées... got the following error code: "Error 1606.  Could not access network location % APPDATA%\ ».  I tried of looking for help on the Java site. and I tried a few suggestions listed... no luck!  CAN SOMEONE PLEASE?

    Thank you!

    gasweetpeach54

    The usual reason for this error message, it's that some of the registry entries mentioned in the following items are damaged.

    http://support.Microsoft.com/kb/886549

    http://support.Microsoft.com/kb/2258121

    If you are unable to fix it by using these methods, try to create a new user account, give administrator privileges and use it to install Java.

    http://Windows.Microsoft.com/en-us/Windows-Vista/create-a-user-account

    http://Windows.Microsoft.com/en-us/Windows-Vista/change-a-users-account-type

  • Cannot install adobe reader software. I get error 1606 could not access network location %APPDATA%\protector.exe

    I have not been able to completely install the Adobe Reader or open pdf files. I'm getting Errorr code 1606 could not access network location %AppData%. I'm not that computer savy and don't know what is the right answer or suggestion should I take without seriously harming the computer. Quitr sure don't miss suggestion

    Hi TERESA-2009.

    (1) since when are you facing this problem?

    Method 1: You can follow the steps described in the article below that addresses this question

    You receive an "Error 1606" error message when you try to install or remove a program from Microsoft

    http://support.Microsoft.com/kb/886549

    (Article applies to Microsoft Programs, steps works great for other programs)

    Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base.
    How to back up and restore the registry in Windows

    You can post your query on the Adobe Forums
    http://forums.Adobe.com/index.jspa

    Thank you, and in what concerns:

    Ajay K

    Microsoft Answers Support Engineer
    ***************************************************************************

  • Get the error message "could not access network location %AppData%.

    Wehen I want to install windows live massenger I get this error massege which is cant access network location %APPDATA%\protector.exe

    Hello hezb,.

    You can watch the article following for assistance to resolve the Error 1606 that you encounter.

    KB Article ID: 886549 -you receive an "Error 1606" error message when you try to install or remove a program from Microsoft

    Is there an automatic FIXIT button that will fix your computer instead of manually change you the registry.
    Then try again and see if you can install Windows Live Messenger.

    I hope this helps.

    Sincerely,

    Marilyn
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think

  • I'm trying to uninstall older versions of Java, I get error1606 cannot access the location %APPDATA%\ network I'm adminastrator how to uninstall?

    I'm trying to uninstall older versions of java, but keep Error 1606 could access the location %APPDATA%\ network I tried everything but not java support says go

    Hello

    I suggest that you run the Fixit in the following Microsoft article and check if it helps.

    You receive an "Error 1606" error message when you try to install or remove a program from Microsoft:

    http://support.Microsoft.com/kb/886549

    Note: If fixit is not enough, then try the steps outlined in Let me fxit muself.

    Hope the information is useful.

  • Is there a way to get a list of all applications / updates that are cached on your server?

    Is there a way to get a list of all applications / updates that are cached on your server?  Of course, we see the space that contains each category.  But I would like a detailed list of the individual items that are actually cached.

    ITD be even better if I could get a scoreboard that showed me how many times a particular point was served to customers.

    Yes.  But you need a little magic Terminal to get the desired data.  Caching server is managed by a sqlite database.  To examine the contents, follow these basic steps:

    1: connect to the database using the following command:

    sudo sqlite3 /Library/Server/Caching/Data/AssetInfo.db

    2: to structure the data, run these two commands to the sqlite command-line prompt:

    .blog column

    . Headers on

    3: to find everything that is stored, run this command (you'll get iCloud cached documents, books, iOS apps, etc.):

    Select * from ZASSET;

    4: to narrow the results down to elements called by software updates, try this:

    Select * from ZASSET where ZURI as "content %";

    You could get a line that looks similar to the following:

    403 2 6 0 2012986793 474949928.477396 476912032.644505 e03448847909547fb8c7d4ecd5a7b6dd FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 on Wednesday, August 5, 2015 18:00:30 GMT

    / Content/downloads/42/44/031-30888/bhrkylcnycxmtug9daw3g4magqb7dl7hba/OSXUpdComb o10.1

    (added the newline for readability)

    It is an OS X Combo update.  It is located on the drive to library/server/cache/Data/FAB32A72-DE33-469D-A7DF-3CE1A1F9A4D2 / the file is probably named 0, but if you want to use it, just add at the end of the .pkg file.

    I hope this helps.  Put server cache saves a lot of data.

    Oh, to quit the sqlite command line tool, simply type .quit and press return.

    Reid

    Apple Consultants Network

    Author - "El Capitan Server - Foundation Services.

    Author - "El Capitan Server - Collaboration & control»

    Author - "El Capitan Server - Advanced Services '.

    : IBooks exclusively available in Apple store

  • Multi-terrain graphs, is there a better way?

    I'm still not good at graphics in LabView, but I think I do a few programs and I can usually get a graph to show with what I want to show him only a few hours of dinking with it autour...

    In any case using graphics certainly made for messy code unless there is a better way to this thread. Basically, this chart shows the four temperature sensors and is updated every minute. A check of stabilization is carried out every 15 minutes. Apparently the only way I could get the multiple locations with time that x-axis it are use an xy graph, but I have my reading on the index individually and each put in it is the own shift register and add it to the chart separately.

    There must be a better way?

    I think that part of your problem is that you are not aware of the option 'Concatenate entries"to build array. You don't need several bays to build the set of clusters, we made connections in graph (pink wire). Just expand the build, wire all clusters, then right-click on the picture of construction and choose 'Concatenate entries. Then, you can use a cluster to store all your berries to graph (orange wire) which will be greatly cleans your diagram.

  • There must be a better way to do this

    There must be a better way to do this!

    25 separate reports - 1 voltage recorded by chanel every minute for 21 hours (end - times will have to be changed)

    Anyone has ideas/directions

    CC

    The DAQ Assistant reads the tensions based on the timings specified, which means that if I set the number of samples finish say 20 and the frequency of samples to 1, then data acquisition will take 20 seconds to save 20 data points (one second) per channel. Then the DAQ pump data to the loop that creates reports (N number of reports).

    TO answer this question: the DAQ Assistant will do exactly what you suggest here.

    Two questions:

    -the loop will be able to separate the different channels ie first report contains data AI1, AI2 and AI3, then the second contains data AI4, AI5 AI6 etc.. ? What is the purpose of the table screws?

    TO answer this question: If you look inside the front loop, you see I have the sub table value function. I have set the index to the increment and then multiply 3 X. The first time in the loop take 0 and multiply by 3 and I get zero. second time through I multiply 1 X 3 and get 3. The second thing I have on the sub table set is giving him a length of 3. This will make return three matrices. So this will give me the next three tables each time through. So the first time through I get AI0 AI1, AI2 AI3 AI4, AI5 second time or however you have configured channels.

    - and what is the function of painting that the subset of table is wired to (can not find the icon of my pallet table)?

    TO answer this question: Index table. Handel, it automatically becomes a 2D array.

  • A better way to generate a reference?

    I am autoindexing by a cluster control array to work with their values.  At the same time, however, I would like to update the value of the front panel control if Boolean value is selected.  Therefore, I also have automatic index through references to the cluster in the same LOOP (see annex VI).  It works, but it seems a little questionable, not to mention tedious if I have several clusters to help index.  Is there a better way to do it?  I was hoping that I could generate a reference of the cluster inside the loop wire, but I suspect that's not possible, because the thread may represent a copy of FP values rather than control FP himself.

    Thank you

    Allan

    You don't need automatic index two.

    You cannot get a reference to the thread of the cluster, but you can go somewhere else: get reference cluster data using the "Value" property  See attachment.

  • Error 1606: Could not access network location % APPDATA%\.

    I am trying to install a game for Windows: Zoo Tycoon 2 Ultimate Collection (which is Zoo Tycoon 2 + 4 expansion packs), on a Vista Home SP2 machine.  When you install disc 1, I almost immediately get the error above,Error 1606: could not access network location % APPDATA%\. I looked at the error on this forum, who led me to the installation page for the installation package located manual download page offline at the: http://www.java.com/en/download/help/error_installshield.xml. When I tried to install the offline installation package, I got the same error, 1606.  I don't know what to do next?  This game comes without a product key, this support won't even take my call.  Thank you-

    This problem occurs because there is incorrect entries in the Shell folder of the user who is logged on to Microsoft Windows. When Windows Installer goes to the sale of Shell folder of the user who is logged on to the computer, Windows Installer cannot locate the correct entry. The solution is inhttp://support.microsoft.com/default.aspx/kb/886549.

    The steps to correct this problem involve editing the Windows registry.  Change the settings of the REGISTRY can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the REGISTRY settings configuration can be solved. Changes to these settings are at your own risk. I suggest that you first back up your registry as follows: http://windows.microsoft.com/en-US/windows-vista/Back-up-the-registry.

    Here are the steps to fix it.

    1. click on start, run, typeregedit in the Open box, and then click OK.

    2. look for the following registry key:

    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell dossiers\

    3 remove the entries that show the path that is listed in the error message.

    886549 KBhttp://support.microsoft.com/default.aspx/kb/886549: Regedit open again. In the left pane, click User Shell Folders, point tonew, click expandable string value, type the value name that you want to restore (AppData) and then press ENTER. Right click on this value, clickchange, type the value in the value data for the value name box, and then clickOK. The value data must be: % USERPROFILE%\AppData\Roaming.

    Step 8 KB 886549 suggests that you also check the values in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders. However, by fixing my problem, I had not to change values in the registry key. If this does not work, follow ALL the steps in the referenced article.

    Good luck. Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Is there a way to get a copy of Windows Media Center 2005 french as I have a valid license key for a version of MC in XP

    Original title: media library

    I have a HP M7330 Media Center with a dead MB machine. Changed the MB & learned, too late, "Mo tattoo" as fact by HP & cannot use the recovery partition to reinstall. I'm looking for a way to get a copy of Windows Media Center 2005 french as I have a valid license key for a version of XP MC, this license does not work with my XP Pro drive & my better half - would like to get this machine in order for the moment.

    Thanks for any help before the machine answers my sledgehammer.

    Luke

    Hello

    Windows XP Media Center is available for OEM only and if you don't have a motherboard the OEM valid, it will not activate.

    The only option would be to get a newer version of Windows if your system supports or get an OEM motherboard (HP) that you can use the recovery on.

    You can see this article if you want to upgrade to Windows 7.

    Upgrade Windows XP to Windows 7

     

    The upgrade to Windows 7: frequently asked questions

  • Error 1606. Could not access network location %APPDATA%\protector.exe

    Whenever I try to install itunes on my computer, I get a pop up that says "Error 1606 could not access network location %AppData%, I can't figure out what to do, I went through the whole" go to start, click on run, run Regedit.exe, go to HKEY_CURRENT_USER--> Software--> Microsoft--> Windows--> the current Version--> explore--> User Shell Folders and ive made sure everythings it and all its how its supposed to be. ' " I have no idea what to do. If anyone knows how to fix it please do not hesitate to post something.

    Thanks to anyone who helps

    Tjballer94

    Run the FixIt from this page:

    http://support.Microsoft.com/kb/2258121

    "A programmer is just a tool that converts the caffeine in code" Deputy CLIP - http://www.winvistaside.de/

Maybe you are looking for