Jump to content

Recommended Posts

Posted

Ok, script wizzards I need to figure out how to push out a template to selected users that would end up in C:\documents and Settings\<user>\Application Data\Microsoft\Templates folder. The user would have to enter their name in the script in a $Username = InPutBox to be added later in the script.

The line FileCopy("C:\test.txt", "C:\Documents and Settings\$Username\Application Data\Microsoft\Templates") appears to run, but the template does not show up in the users profile. I do not get any error messages and the file is not copied. I suspect it has to do with either how the $username is processed or perhaps the fact that Application Data is a hidden folder.

Any ideas?

  • Developers
Posted

Ok, script wizzards I need to figure out how to push out a template to selected users that would end up in C:\documents and Settings\<user>\Application Data\Microsoft\Templates folder. The user would have to enter their name in the script in a $Username = InPutBox to be added later in the script.

The line FileCopy("C:\test.txt", "C:\Documents and Settings\$Username\Application Data\Microsoft\Templates") appears to run, but the template does not show up in the users profile. I do not get any error messages and the file is not copied. I suspect it has to do with either how the $username is processed or perhaps the fact that Application Data is a hidden folder.

Any ideas?

<{POST_SNAPBACK}>

you have the variable inside the quoted string... should be :

"C:\Documents and Settings\" & $Username & "\Application Data\Microsoft\Templates")

But what about doing it this way:

FileCopy("C:\test.txt", @AppDataDir & "\Microsoft\Templates")

Should give the correct directory without any prompting...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...