rts329 Posted February 19, 2023 Posted February 19, 2023 Hi all. I'm using Task Scheduler to restart my computer at, for example, 12:00am, and then also to run an AutoIt script at 12:05am. The script works when I just run it by manually running the script, and it also works if I run it by manually selecting "Run" from Task Scheduler, but when it runs following the system reboot it does not work. Following the system reboot, the application runs and then the Windows Explorer box (what opens when the Windows key is pressed) opens, and no text is entered anywhere. Can someone help me understand why this is the case and suggest how I can get around it? ``` ; Set username and password for autologin here Local $username = "myUser" Local $password = "myPass" ; Set app login window ID from AutoIt ; Open Au3Info and go to Window Info -> Window -> Class. Copy/paste the window class and place between "[CLASS:]" Local $appWindowID = "[CLASS:WindowsForms10.Window.8.app.0.1d2098a_r7_ad1]" ; Set 'target' property in app shortcut properties here Local $appPath = "C:\app.exe" ; SCRIPT ; Wait 2 seconds before running script Sleep(2*1000) ; Open app Run($appPath) ; Get app login window once it opens $window = WinWaitActive($appWindowID) ; Wait 5 seconds for window to load, then activate it Sleep(5*1000) WinActivate($window) ; Click on username field MouseClick("left", 956, 560) ; Select all and delete SEND("^a") SEND("{BACKSPACE}") ; Enter in username SEND($username) ; TAB to password box SEND("{TAB}") ; Enter in password SEND($password) ; Press "ENTER" to log in SEND("{ENTER}") ```
Moderators Melba23 Posted February 21, 2023 Moderators Posted February 21, 2023 Moved to the appropriate AutoIt General Help and Support forum, as the Developer General Discussion forum very clearly states: Quote General development and scripting discussions. Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums. Moderation Team Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Trong Posted February 21, 2023 Posted February 21, 2023 Try adding a GUI to the program. You will find that after Windows starting the GUI it doesn't show up, although you can see your program already running in the TaskManager. But if you pay attention, it will be run under the system user account, so there is no interaction with the current user's Desktop. Regards,
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