coffeeturtle Posted November 15, 2012 Posted November 15, 2012 (edited) Has anyone seen this odd behavior where an autoit program is running on a remote computer. When you use Microsoft's Remote Desktop client to remote in on that machine, no problem. But if the user at some point later logs on locally to that same machine, autoit crashes? I'm not sure why it happens. I was just wondering if anyone in general ever has experienced this and maybe what they did to stop the odd behavior. Thank you! Edited November 15, 2012 by coffeeturtle
spudw2k Posted November 15, 2012 Posted November 15, 2012 I can't say I've seen that behavior in general, but that's a tough determination without knowing the nature of the script which produces the issue. Furthermore inspection of the actual code involved might be required to truly narrow the cause. Can you elaborate some? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
DicatoroftheUSA Posted November 15, 2012 Posted November 15, 2012 It is hard to tell with the info you gave. But what I am guessing, is that you don't have terminal services installed. And you are not running your script as a service. When they log in, you get logged off, therefore your script closes naturally. Statism is violence, Taxation is theft. Autoit Wiki
coffeeturtle Posted November 15, 2012 Author Posted November 15, 2012 Sorry about the scant amount of information. I was kind of wondering it was a bug with autoit since my script has nothing to do with remote access. I'm going to try to narrow down some of the code and post it here. Line numbers don't match well with the error messages, but maybe JScript's autoiterrortrap might help me. Thanks again and I will try to post soon.
spudw2k Posted November 16, 2012 Posted November 16, 2012 Dicator might be on to something. Are you executing the script as the same user as the login culprit? Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
DicatoroftheUSA Posted November 16, 2012 Posted November 16, 2012 (edited) You can try adding the following #include <File.au3> OnAutoItExitRegister ( "_exit" ) global $gsLogPath=@DesktopCommonDir&"log.txt" _FileWriteLog($gsLogPath, "script started") ;your script here Func _exit() local $sMethod Switch @exitMethod case 0 $sMethod="Natural closing." case 1 $sMethod="close by Exit function." case 2 $sMethod="close by clicking on exit of the systray." case 3 $sMethod="close by user logoff." case 4 $sMethod="close by Windows shutdown." EndSwitch Local $sLogMsg="Exiting with exit code "&@exitCode& " by "&$sMethod _FileWriteLog($gsLogPath, $sLogMsg ) exit EndFunc You could also launch your script with PSEXEC if it is not gui based. Edited November 16, 2012 by DicatoroftheUSA Statism is violence, Taxation is theft. Autoit Wiki
guinness Posted November 16, 2012 Posted November 16, 2012 Another way using an Array. #include <File.au3> OnAutoItExitRegister('_Exit') Global $__sLogFilePath = @ScriptDir & 'log.txt' _FileWriteLog($__sLogFilePath, 'Script started') ; Script here. Func _Exit() Local $aExit[5] = ['Natural closing.', 'Closed by Exit function.', 'Closed by clicking on exit of the systray.', _ 'Closed by user logoff.', 'Closed by Windows shutdown.'] _FileWriteLog($__sLogFilePath, 'Exiting with exit code ' & @exitCode & ' by ' & $aExit[@exitCode]) $aExit = 0 Exit @exitCode EndFunc ;==>_Exit UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018
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