Jump to content

Logic wrong


Recommended Posts

What am I doing wrong?  I'm trying to skip over some code if a file exists.

Opt("WinWaitDelay", 100)
Opt("WinTitleMatchMode", 4)
Opt("WinDetectHiddenText", 1)
Opt("MouseCoordMode", 0);While 1 <> 1
; Install Servant Salamander

If _OSVersion() = 'Win7' Or _OSVersion() = 'Win7SP1' Or _OSVersion() = 'Win7X64' Or _OSVersion() = 'Win7SP1x64' Then
    $ProgramFiles = "C:\Programs\"
Else
    $ProgramFiles = "C:\Program Files\"
EndIf

;*~*~*~*~*~*~*~*~*~*~ This is where my problem is
msgbox(48, "Salamander = ", $ProgramFiles & "Salamander\salamand.exe")
;This file does exist   C:\Programs\Salamander\salamand.exe
If not FileExists("$ProgramFiles & Salamander\salamand.exe") then
    ;This doesn't recognize that it does exist
Msgbox(48, "This should not display","This should not display")

EndIf
Exit
Func _OSVersion()
    Local $OS_Version, $servicepack_version
    $OS_Version = StringStripWS(StringRegExpReplace(@OSVersion, "(WIN_)|(Microsoft )|(Windows )|(\(TM\))|( Ultimate)", ""), 8)
    $OS_Version = StringRegExpReplace(StringRegExpReplace($OS_Version, '2008', 'Win7'), 'VISTA', 'Vista')
    If RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion", 'CurrentBuildNumber') > 7000 Then $OS_Version = 'Win7'
    $servicepack_version = StringReplace(@OSServicePack, "Service Pack ", "SP")
    If @error = -1 Then $servicepack_version = ""

    ConsoleWrite($OS_Version & $servicepack_version & StringRegExpReplace(@OSArch, '(X86)', '') & @CRLF)
    Return $OS_Version & $servicepack_version & StringRegExpReplace(@OSArch, '(X86)', '')
EndFunc   ;==>_OSVersion

 

Thanks,

Docfxit

Link to comment
Share on other sites

Shouldn't it be:

If Not FileExists($ProgramFiles & "Salamander\salamand.exe") Then

 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

:) 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

No. You can't delete threads.
But don't bother. There are many similar threads around ;) 

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

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