Tigerweld Posted May 31, 2016 Posted May 31, 2016 Trying to check for file exists, but for some reason it isn't working and I think it may be something to do with Windows 7 permissions? Anyone else run into this problem? I get File does not exist no matter what. If FileExists ("c:\windows\system32\test.txt") Then MsgBox(4096, "Yes", "File does exist") Else MsgBox(4096, "No", "File does not exist") EndIf
youtuber Posted May 31, 2016 Posted May 31, 2016 (edited) #RequireAdmin If FileExists(@WindowsDir & "\System32\test.txt") Then MsgBox(4096, "Yes", "File does exist") Else MsgBox(4096, "No", "File does not exist") EndIf Edited May 31, 2016 by youtuber
EmilyLove Posted May 31, 2016 Posted May 31, 2016 Add this line to the top of your script #RequireAdmin
Developers Jos Posted May 31, 2016 Developers Posted May 31, 2016 Are you running on a X64 windows version and running with autoIt3 x86? 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.
Tigerweld Posted May 31, 2016 Author Posted May 31, 2016 compiling it as x64 did the trick! thanks. Will this script work on a x86 computer?
Terenz Posted May 31, 2016 Posted May 31, 2016 (edited) 2 hours ago, Tigerweld said: compiling it as x64 did the trick! thanks. Will this script work on a x86 computer? From the docs: Running the 32-bit version of AutoIt on a x64 System For Files, Windows has a special redirection mechanism for some system directories : Directories 32-bit Value 64-bit Value @SystemDir @WindowsDir & "\System32" @WindowsDir & "\SYSWOW64" @ProgramFilesDir {SystemDrive} & "\Program Files (x86)" {SystemDrive} & "\Program Files" It's possible to access the 64-bit version of those directories by disabling the redirection mechanism. #include <WinAPIFiles.au3>_WinAPI_Wow64EnableWow64FsRedirection(True) Additional information can be found at MSDN. For registry interaction, use HKCR64 or HKLM64 to bypass the redirection mechanism see Registry Functions documentation. Edited May 31, 2016 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now