/build/static/layout/Breadcrumb_cap_w.png

Kace K1000 Scripting

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?

1 Comment   [ + ] Show comment
  • Can i stire up an old thread please ... I'm having he same issue, but i am using a .bat file. still i get the computername instead of the username when using $username$. how did you resolve this and do you have an example for me? - chneijens 6 years ago

Answers (2)

Answer Summary:
Running as a bat fixed it. I should have done that in the first place.
Posted by: dchristian 11 years ago
Red Belt
2
Who are you running the script as? By default everything runs as local system. This is probably why %username% isn't working.

Comments:
  • I am trying to run it as the user logged in. - nwhistler 11 years ago
    • 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 - dchristian 11 years ago
  • what version of the agent are you running? - hmoore 11 years ago
  • 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. - nwhistler 11 years ago
Posted by: nwhistler 11 years ago
Senior Purple Belt
0
Running as a bat fixed it. I should have done that in the first place.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ