Jump to content

x86 AutoIt can't see tscon.exe


Recommended Posts

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
Link to post
Share on other sites

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
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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...