Jump to content

Making a program run based on file existing


tsicoupe
 Share

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%")
else
   (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

Link to comment
Share on other sites

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

You must read Basic of AutoIt

Saludos

Edited by Danyfirex
Link to comment
Share on other sites

  • Developers

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. ;)

Jos

Edited by Jos

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...