View Full Version : Am I being dumb?

02-17-2004, 01:53 PM
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.

02-17-2004, 02:08 PM
Hi. The ticket might be _SystemFolder as seen here:


Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

02-17-2004, 02:16 PM
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.


02-17-2004, 03:07 PM
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?


02-17-2004, 03:19 PM
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:

-- 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
It's a bit longer, but easier to understand.

02-17-2004, 03:21 PM
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");


Edit - ooops, Colin beat me to it.

02-17-2004, 03:24 PM
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 -


Thanks anyway.

02-17-2004, 04:10 PM
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 (http://www.indigorose.com)