Scripting Question

"File does not exist: C:\Windows\system32\curl.exe", yet it does

02/19/2019 865 views

Online KScript, SMA version 9.0.270

Output log says: "

File does not exist: C:\Windows\system32\curl.exe"

even though the file actually exists:

C:\Users\acutech\Downloads>dir C:\Windows\system32\curl.exe
 Volume in drive C has no label.
 Volume Serial Number is 72A8-CA1F

 Directory of C:\Windows\system32

04/11/2018  03:34 PM           424,448 curl.exe
               1 File(s)        424,448 bytes

Here's what the script looks like:

If I manually move \windows\system32\curl.exe to \ before I run the script, (which such manual work defeats the whole idea of using the SMA), and make corresponding changes to the script, the script works. But this script simply won't find/run "C:\Windows\System32\curl.exe".

I at first thought the "Local System" account might be restricted from running .exe's in "\windows\system32", but I also tried changing the "run as" from "Local System" to another admin account, with the same behavior.

As another test, I altered the script to use "\windows\system32\xcopy.exe" to copy "\windows\system32\xcopy.exe" to "\", and that works, but using "\windows\system32\xcopy.exe" to copy "\windows\system32\curl.exe" results in "file not found". I've compared the properties/permissions on the two files, and they seem to be identical.

Anyone have an explanation/fix?




Answer Summary:
0 Comments   [ + ] Show comments


Answer Chosen by the Author


it is most likely a sysnative problem.  Kace is a 32 bit client running on a 64 machine and it will default to the syswow64 directory looking for apps.  try using %windir%\sysnative instead of %windir%\system32



Answered 02/20/2019 by: SMal.tmcc
Red Belt

  • Well, that was magic! Almost 30 years of supporting Windows and I've never heard of "sysnative".

    And it's not a directory name in "\windows", and it's not an environment variable.

    Just.... wow! (but not wow64)

    Thanks, Nick The Ninja! You've solved my issue!

    • I am not Nick, that is one of the Kace staff that review answers and will endorse them for credibility. He also posts too! Great guy, If you go to UserKon look him up
      • Ahh, my bad. I saw the "Endorsed by" as a "written by". My apologies.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:


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