Xichael

x86 AutoIt can't see tscon.exe

5 posts in this topic

#1 ·  Posted (edited)

The 64 bit version is able to access C:\Windows\System32\tscon.exe just fine, but 32 bit can't find it.

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

Example()

Func Example()
    ; Create a constant variable in Local scope of the filepath that will be read/written to.
    Local Const $sFilePath = "C:\Windows\System32\tscon.exe"

    Local $iFileExists = FileExists($sFilePath)

    ; Display a message of whether the file exists or not.
    If $iFileExists Then
        MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist returned: " & $iFileExists)
    Else
        MsgBox($MB_SYSTEMMODAL, "", "The file doesn't exist." & @CRLF & "FileExist returned: " & $iFileExists)
    EndIf
EndFunc   ;==>Example

 

Edited by Xichael

Share this post


Link to post
Share on other sites



#2 ·  Posted

Your deleting C:\Windows\System32\tscon.exe, why?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

No. That's just the example taken from: https://www.autoitscript.com/autoit3/docs/functions/FileExists.htm

I'm actually trying to launch the exe from a script using:

ShellExecute('tscon', '1 /dest:console', '', 'runas')

After hours of trying and failing to get it working, I finally found this issue.

Now that I know, I'll just make sure to run x64, but thought I should bring this to people's attention. It's a weird one.

Edited by Xichael

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Sorry, I removed that line. Guess it served a purpose in the original example script.

Good to know about that WoW64 redirection stuff. Pretty esoteric stuff. Thanks!

Edited by Xichael

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