Copy Signature template to %appdata%\Microsoft\Signatures
I am trying to unzip a file into all user profiles using %appdata%\Microsoft\Signatures as the target. All this does is create the folder in c:\Program Files\Dell\Kace. I am using the scripting tab in the K1000, the zip file is uploaded as a dependency. If I put in a specific users profile as a destination it works perfectly. Is there an easy way to do this?
Answers (7)
I
Log for Test appdata on
Started: 01/24/2013 13:57:52
Finished: 01/24/2013 13:57:53
Elapsed Time: 1 second
Status: 1
Output Log
Running as: sholcomb
Debug Log
Running kbot: runkbot 170 1359053869 Validating kbot xml Kbot xml C:\ProgramData\Dell\KACE\kbots_cache\170-1359053863_expanded.xml, Validation Success Kbot Config Info - Start id=170 name=Test appdata version=1359053863 type=policy execute disconnected=false logged_off=false execute events Kbot Config Info - Finish
When you run a Online KScript with the default RunAs option i.e. System Account, the script will run under system account and the path for the variables on windows 7 will be
C:\Windows\system32>ECHO %APPDATA% C:\Windows\system32\config\systemprofile\AppData\Roaming C:\Windows\system32>ECHO %USERPROFILE% C:\Windows\system32\config\systemprofile
Hence, please check if the file gets unzipped to above directories or run the script as "Run as user logged in to console"
Comments:
-
yes I am running as user logged in to console. - holcomb36 11 years ago
It works perfectly when I do this using a .txt file.
cd C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\165 (yes I change this to match the dir of the file)
copy test.txt %userprofile%\appdata\Roaming\Microsoft\Signatures
I am running as User Logged in to console.
However the files I need to copy are in a folder and are .htm .xml .png .thmx
I tried just adding the .htm file as a dependency and doing only that file but still nothing. I get a Run Success, but nothing in the folder. Tried Zipping .htm file and doing it that way and still nothing in folder.
What I need is a folder containing 4 files and an .htm file to be placed in every users signature folder so that they all have the required Outlook Signature format.
But it does unzip if I put in a specific user such as C:\users\jdoe\appdata\Roaming\Microsoft\Signatures, just doesnt work for %userprofile%appdata\Roaming\Microsoft\Signatures (I have also tried %appdata% as another user advised.
KACE Tech suggested batch file
cd C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\165
copy test.txt %userprofile%\appdata\Roaming\Microsoft\Signatures
and it only works with a .txt file doesnt work with a .htm or .png
Comments:
-
overlooked kace has built in unzip in script the target should be %appdata%\Microsoft\Signatures
is it a typo that you a missing a \ after %userprofile%? - SMal.tmcc 11 years ago-
are you running this online? - SMal.tmcc 11 years ago
-
yes just a typo the \ is before appdata and yes I am running it online. - holcomb36 11 years ago
-
not sure what zip program kace uses on the kbox to run the unzips with
almost sounds like a bug with the call - SMal.tmcc 11 years ago
-
KACE told me to run the batch file below instead but that only works if it is a .txt it wont work for any other file. Thanks for helping. - holcomb36 11 years ago
Comments:
-
I have since fixed the typo in dependency - holcomb36 11 years ago
-
the file looks good. I would try a different variable in the destination path
maybe c:\users\%USERNAME%\appdata\Roaming\Microsoft\Signatures
that directory does already exist correct, I do not have one of those in my profiles - SMal.tmcc 11 years ago