tsicoupe

Making a program run based on file existing

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

You must read Basic of AutoIt

Saludos

Edited by Danyfirex

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                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