Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2006
    Posts
    345

    Grin shell.GetFolder problem

    i'm trying to grab the path for the All Users Application Data folder, and then add a hard coded folder and file path to it, so i can check for file existence, however, i'm doing something wrong and keep getting an error

    here is my code

    Code:
    appdatacommon = shell.GetFolder(SHF_APPLICATIONDATA_COMMON)
    appdatacommon_corrected = String.Replace(appdatacommon, "\\", "\\\\", false);
    app_data_common = appdatacommon_corrected .. "\\My_Folder\\My_Sub-Folder" ;
    The error i get back is
    On Click Line xx: attempt to index global `shell' (a nil value)
    where xx is the very first line


    can anyone help point me in the right direction please, on my machine app_data_common should equal this string
    C:\\Documents and Settings\\All Users\\Application Data\\My_Folder\\My_Sub-Folder

    TIA, i will continue searching through the help section and the forum, in the mean time a kick in the right direction would be appreciated

  2. #2
    Join Date
    May 2006
    Posts
    5,380
    check your caps

    shell.GetFolder

    should be

    Shell.GetFolder

    EDIT:

    also why use the string replace ?? am i missing something

    this seems to work for me
    appdatacommon = Shell.GetFolder(SHF_APPLICATIONDATA_COMMON)
    app_data_common = appdatacommon .. "\\My_Folder\\My_Sub-Folder" ;
    Last edited by RizlaUK; 06-11-2007 at 12:38 PM.
    Open your eyes to Narcissism, Don't let her destroy your life!!

  3. #3
    Join Date
    Oct 2006
    Posts
    345
    oh man ...... i have been staring at that for about 2 hours and the problem has been staring me in the face all along

    i guess what they say about a fresh set of eyes is correct.

    and for your question about the string replace, its because later in the project i use the full path for some other stuff, like file transferring, and if i am not mistaken the Shell.GetFolder(SHF_APPLICATIONDATA_COMMON) returns only single "\" which means when i use the path later it will error...... right ?

    thank you again for the very speedy reply, boy do i feel stupid right now

  4. #4
    Join Date
    May 2006
    Posts
    5,380
    lol, its true, sometimes its worthwhile to walk away for a short break and things seem clearer on return

    and yes, Shell.GetFolder only returns a single backslash but this is only a issue when the path is used in text form (in input or paragraph objects)

    iv never needed to amend any of the paths returned by ams functions, you only need to use a double backslash when adding file paths manual

    but as i dont know what you intend on doing i could be wrong, im sure you have it in hand

    good luck with your project
    Open your eyes to Narcissism, Don't let her destroy your life!!

  5. #5
    Join Date
    Oct 2006
    Posts
    345
    that got it, all works fine now, that little section is part of a much larger section, and yup, there is one particular part that uses the file path in string format, or at least on earlier testing it errored without the double back slashes, now seems to work ok

    cheers mate, appreciate the help

Similar Threads

  1. Problem installing fonts
    By ByronFS in forum Setup Factory 7.0
    Replies: 5
    Last Post: 05-08-2006, 12:23 PM
  2. Video Problem
    By ScottDuncan in forum AutoPlay Media Studio 5.0
    Replies: 0
    Last Post: 07-10-2004, 01:38 PM
  3. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  4. PROBLEM: Setup Requests Disk 2 in a Single File Setup
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-09-2002, 02:04 PM
  5. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 AM

Posting Permissions

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