jriker1 Posted November 19, 2018 Posted November 19, 2018 I have an autoit script that maps two drives and closes. have it set to run as a Windows 10 scheduled task. Running it manually form the desktop it works fine. When I remote desktop to the desktop after a reboot, scheduled task shows it runs, but there are no mapped drives. Windows 10 set to auto login. Logging in with the same user remotely that it auto logs in with and the schedule task is set to run as. Is there some additional setting to make this really run as the person on the desktop? Thanks. JR
Moderators Melba23 Posted November 19, 2018 Moderators Posted November 19, 2018 Moved to the appropriate forum. 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
ModemJunki Posted November 19, 2018 Posted November 19, 2018 29 minutes ago, jriker1 said: I have an autoit script that maps two drives and closes <etc..> Can you share a copy of the script that is changed a little so it doesn't show your actual user credentials or other private information? Always carry a towel.
jriker1 Posted November 19, 2018 Author Posted November 19, 2018 You bet. Guessing the script itself is probably not the issue, more something I need to maybe set in Scheduled Task: #include <AutoItConstants.au3> $sUsername="<domain>\<username>" $sPassword="<password>" DriveMapDel("X:") Sleep(2500) DriveMapAdd("X:", "\\homeserver\e$", $DMA_DEFAULT, $sUsername, $sPassword) DriveMapDel("Y:") Sleep(2500) DriveMapAdd("Y:", "\\mediacenter\d$", $DMA_DEFAULT, $sUsername, $sPassword) Also Scheduled task: - Trigger at Logon any user This is the only part I'm wondering, if I change it to run as me if it would od anything. Not sure what any user is anyway. Thanks. JR
ModemJunki Posted November 19, 2018 Posted November 19, 2018 Please use code tags when posting example code (the "<>" in the post controls). Can you try to capture the return from DriveMapAdd to a logfile like below? #include <AutoItConstants.au3> #include <File.au3> $sUsername="<domain>\<username>" $sPassword="<password>" $s_delRet = DriveMapDel("X:") _FileWriteLog(@ScriptDir & "\DriveMapLog.log", "Deletion of X: returned " & $s_delRet) Sleep(2500) $s_mapRet = DriveMapAdd("X:", "\\homeserver\e$", $DMA_DEFAULT, $sUsername, $sPassword) _FileWriteLog(@ScriptDir & "\DriveMapLog.log", "Mapping of X: returned " & $s_mapRet) $s_delRet = DriveMapDel("Y:") _FileWriteLog(@ScriptDir & "\DriveMapLog.log", "Deletion of Y: returned " & $s_delRet) Sleep(2500) $s_mapRet = DriveMapAdd("Y:", "\\mediacenter\d$", $DMA_DEFAULT, $sUsername, $sPassword) _FileWriteLog(@ScriptDir & "\DriveMapLog.log", "Mapping of Y: returned " & $s_mapRet) Always carry a towel.
jriker1 Posted November 20, 2018 Author Posted November 20, 2018 (edited) OK I'll give this a try. Stay tuned. For reference is 0 or 1 good. I ran this manually and got a 0 for the X: drive and a 1 for the Y: drive and the Y: drive was mapped and the X: drive wasn't. This is a manual run. EDIT: Should also say I'm seeing that for some reason the X: fails on Windows 10 and Y: works. On WIndows 8 both work. EDIT EDIT: What's interesting even though I get a 0 or 1 on some and in File Explorer just shows the Y: drive, if I drop to an admin DOS prompt and do a net use, it shows both X: and Y: mapped. Odd it's not showing in Windows File Explorer plus having errors. Thanks. JR Edited November 20, 2018 by jriker1
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