Jump to content

Making a program run based on file existing

Recommended Posts


Hello i am having some issues with this working. I am trying to run this to see if the file is located in program files or on 64bit program files x86 and then run the program. Here is what i have so far:

If FileExists "%ProgramFiles%\Common Files\SMART Technologies\SMART Product Update\activationwizard.exe"
   (Then $vPPATH="%PROGRAMFILES(x86)%")

Run "($vPPATH)\Common Files\SMART Technologies\SMART Product Update\activationwizard.exe"

I know this is probably pretty basic but I am new here and cannot get this variable to work properly. Any help would be appreciated. Thanks

Share this post

Link to post
Share on other sites
Run ($vPPATH & "\Common Files\SMART Technologies\SMART Product Update\activationwizard.exe")

You must read Basic of AutoIt


Edited by Danyfirex

Share this post

Link to post
Share on other sites

There are more things wrong with that code:

  • Brackets missing for FileExists function.
  • Environment variables won't be resolved unless specified
  • EndIf is missing.

Start with opening the helpfile and checking syntax. ;)


Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now