I am trying to run a script to copy files from a specific location in the user folder to a network folder using %USERNAME%.

The idea is to periodically backup a users NK2 file. I am using xcopy to do the copy and the command works out side of Kace but doesn't work in Kace's scripting.

The basics are:

Directory: C:\Windows\System32
File: xcopy.exe
parameters /D "C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Outlook\*.*" "H:\outlook data"

Does anyone know another way of using Kace to copy out of the user profile? Or have any suggestions?
Answer Summary:
Running as a bat fixed it. I should have done that in the first place.
Cancel
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Community Chosen Answer

2
Who are you running the script as? By default everything runs as local system. This is probably why %username% isn't working.
Answered 04/02/2012 by: dchristian
Red Belt

  • I am trying to run it as the user logged in.
    • Have you tried running it as a shell script? You should just be able to copy and paste your bat file right into the script text. Make sure you change the script name from script.sh to script.bat
  • what version of the agent are you running?
  • We are running v5.3.53053. I actully wasn't running it as a bat file but rather calling xcopy to run with these parameters. I will try it as a bat file.
Please log in to comment

Answers

0
Running as a bat fixed it. I should have done that in the first place.
Answered 04/02/2012 by: nwhistler
Senior Purple Belt

Please log in to comment
Answer this question or Comment on this question for clarity

Share