Scripting Question

Checking to see if a specific EXE files is located on users desktops.

01/14/2015 912 views
Using Online Kscript want to see if current logged in user has a specific program on there desktop (small single exe to change network settings)
at the "Verify" step I have: 
  1. Verify a file exists...
  2.     Directory: C:\Users\%UserName%\Desktop
  3.     File: "NAME OF EXE"
The status detail i'm getting in Kace is "File does not exist: C:\Users\AE-52$\Desktop\name of exe.exe
Instead of the current user it is showing the computer name with a $ (AE-52$).
is this possible to do using a script?
Answer Summary:
0 Comments   [ + ] Show comments


All Answers

you need to run the script as the logged-in user
Answered 01/14/2015 by: SMal.tmcc
Red Belt

  • you should be able to use for directory:
  • Logged-in User was the answer, Thanks!
    • any time you use user level windows variables you need to run it as the user. Otherwise the scripts run as system and know nothing about variables like %username% or %homepath%
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