Am I being dumb?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • dulux1309
    Indigo Rose Customer
    • Feb 2003
    • 172

    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
  • Corey
    Indigo Rose Staff Alumni
    • Aug 2002
    • 9745

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



    Corey Milner
    Creative Director, Indigo Rose Software

    Comment

    • dulux1309
      Indigo Rose Customer
      • Feb 2003
      • 172

      #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

      • dulux1309
        Indigo Rose Customer
        • Feb 2003
        • 172

        #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

        • Colin
          President
          • Jan 2000
          • 135

          #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

          • rhosk
            Indigo Rose Customer
            • Aug 2003
            • 1698

            #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.



            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

            • dulux1309
              Indigo Rose Customer
              • Feb 2003
              • 172

              #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

              • Corey
                Indigo Rose Staff Alumni
                • Aug 2002
                • 9745

                #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