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?
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 7 years ago
Answers (2)
Answer Summary:
Running as a bat fixed it. I should have done that in the first place.
Running as a bat fixed it. I should have done that in the first place.
Please log in to answer
Posted by:
dchristian
12 years ago
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 12 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 12 years ago
-
what version of the agent are you running? - hmoore 12 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 12 years ago
Posted by:
nwhistler
12 years ago