Andromo - Start Making Apps - Free Signup

Announcement

Collapse
No announcement yet.

Am I being dumb?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Am I being dumb?

    Hi all,

    I am trying to perform a very simple action, and I have performed this before in an earlier version but it appears to have changed or perhaps i have just forgotten how I did it. I would like to click a button and have a file copied to the %systemroot%, be it WINNT, WINDOWS or whatever the client machine is running. My code is below, but I am getting an error.

    I have searched the help files as it appears I am having a problem with the syntax of the %systemroot% end of the statement, but I cannot find anything in the help files.

    code follows...
    -----------------------------------------
    File.Copy("secdata\\drivers\\Crop Software\\SC Direct Sources", "%systemroot%", , , , , nil)
    -----------------------------------------

    Your time is appreciated.
    With our fists clenched,
    We cannot shake hands

  • #2
    Hi. The ticket might be _SystemFolder as seen here:

    http://www.indigorose.com/webhelp/am..._Variables.htm

    Corey Milner
    Creative Director, Indigo Rose Software

    Comment


    • #3
      Outstanding!

      Thanks for that - it turns out I was after _WindowsFolder, but the pointer to the info was what I actually needed.

      Sharp work, as always.

      Thanks
      With our fists clenched,
      We cannot shake hands

      Comment


      • #4
        Spoke too soon?

        Hi again,

        I have amended the code for the following and nothing is getting created in the Windows folder, despite no error message being produced on compile.

        code follows
        ------------------------------
        Folder.Create("_WindowsFolder\\SC Direct Sources");
        ------------------------------

        Is anything drastically wrong with this?

        On another note - I can copy files, but can I copy entire folders?

        Thanks
        With our fists clenched,
        We cannot shake hands

        Comment


        • #5
          Try this:
          Folder.Create(_WindowsFolder.."\\SC Direct Sources");

          Or better yet, to understand what is happening when you want to mix "variables" and "literals", try doing it this way:

          Code:
          -- Assign a variable the value of another variable
          folderpath = _WindowsFolder;
          
          -- Append a text string to a variable
          folderpath = folderpath .. "\\SC Direct Sources";
          
          -- Pass a variable to an action as an argument
          Folder.Create(folderpath);
          It's a bit longer, but easier to understand.

          Comment


          • #6
            delux1309, what exactly are you trying to do? If you're trying to copy folders recursively, ol' Worm here at the forum has an excellent dll that does just that.

            http://www.indigorose.com/forums/sho...&threadid=6402

            Your syntax for creating a folder should be -

            Folder.Create("_WindowsFolder.." \\SC Direct Sources");

            HTH.

            Edit - ooops, Colin beat me to it.
            Regards,

            -Ron

            Music | Video | Pictures

            Comment


            • #7
              Done

              Sorry guys, I have since learned to read the manual and solved my own issue. For anyone else struggling with this, the syntax is as follows -

              Folder.Create(_WindowsFolder.."\\foldername");

              Thanks anyway.
              With our fists clenched,
              We cannot shake hands

              Comment


              • #8
                Yep, double dot concatenates values, (with string values in quotes) glad to hear you got it going, kewl!

                Corey Milner
                Creative Director, Indigo Rose Software

                Comment

                Working...
                X