Is it possible to have Kace test for a 'directoryexists' using %APPDATA% or any variable?
my test is failing for a directory, I see the following
Output Log
Running as: win7_test
Directory does not exist: %appdata%\Microsoft\Windows\Start Menu\COMPANY
Activity Log
Checking if directory exists: %appdata%\Microsoft\Windows\Start Menu\COMPANY
The thing is, this directory does exist. I can copy and paste that exact path, under the WIN7_test account and it opens that directory. Kace is failing to test that directory path I give it.
Anybody know how to do this?
Output Log
Running as: win7_test
Directory does not exist: %appdata%\Microsoft\Windows\Start Menu\COMPANY
Activity Log
Checking if directory exists: %appdata%\Microsoft\Windows\Start Menu\COMPANY
The thing is, this directory does exist. I can copy and paste that exact path, under the WIN7_test account and it opens that directory. Kace is failing to test that directory path I give it.
Anybody know how to do this?
0 Comments
[ + ] Show comments
Answers (3)
Answer Summary:
What if you tried this as a bat script ? IF EXISTS %appdata%\Microsoft\Windows\Start Menu\COMPANY ( DO SOMETHIHNG )
What if you tried this as a bat script ? IF EXISTS %appdata%\Microsoft\Windows\Start Menu\COMPANY ( DO SOMETHIHNG )
Please log in to answer
Posted by:
dchristian
12 years ago
What if you tried this as a bat script ?
IF EXISTS %appdata%\Microsoft\Windows\Start Menu\COMPANY (
DO SOMETHIHNG
)
IF EXISTS %appdata%\Microsoft\Windows\Start Menu\COMPANY (
DO SOMETHIHNG
)
Comments:
-
Yup that should work. - ohiosoundguy 12 years ago
Posted by:
andibogard
12 years ago
Posted by:
snissen
12 years ago
Two comments:
1. With the 5.1 KBOX agents, in a script you could "Verify a directory exists" with environment variables like %SystemRoot% and %AppData%. With the 5.3 KBOX agents, this now fails, which is what the documentation always said.
2. Remember that %AppData% is a directory under the %UserProfile%, which means the script should be running in a user context (Run As ... User). With the 5.1 KBOX agent and the script running as Local System, I discovered that %AppData% was undefined, while %UserProfile% pointed to %SystemRoot%\system32\config\systemprofile.
Sande
1. With the 5.1 KBOX agents, in a script you could "Verify a directory exists" with environment variables like %SystemRoot% and %AppData%. With the 5.3 KBOX agents, this now fails, which is what the documentation always said.
2. Remember that %AppData% is a directory under the %UserProfile%, which means the script should be running in a user context (Run As ... User). With the 5.1 KBOX agent and the script running as Local System, I discovered that %AppData% was undefined, while %UserProfile% pointed to %SystemRoot%\system32\config\systemprofile.
Sande