Sign in to follow this  
Followers 0
chrisT

Need #RequireAdmin to run, but my network drives aren't accessable

3 posts in this topic

Hi, I require #RequireAdmin to run Schtask.exe i.e create a Windows Scheduled Task, however, if I do then when running the following I will not see any network drives.

#RequireAdmin ;Comment Out = NO SCHEDULE TASK CREATED, Not Commented Out = Can't access Network Drives

#include <MsgBoxConstants.au3>

$CMD = 'schtasks /Create /tn "TESTDEL" /tr "\"C:\Program Files (x86)\AutoIt3\SciTE\Koda\FD.exe\"" /sc weekly /d MON /st 17:00  /RL HIGHEST /F'
EnvSet("PATH", @WindowsDir & "\sysnative;" & EnvGet("PATH") )
$iCreateSchedule = Run('"' & @ComSpec & '" /k ' & $CMD, @SystemDir)

Example()

Func Example()
    ; Create a constant variable in Local scope of the message to display in FileSelectFolder.
    Local Const $sMessage = "Select a folder"

    ; Display an open dialog to select a file.
    Local $sFileSelectFolder = FileSelectFolder($sMessage, "",6)
    If @error Then
        ; Display the error message.
        MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
    Else
        ; Display the selected folder.
        MsgBox($MB_SYSTEMMODAL, "", "You chose the following folder:" & @CRLF & $sFileSelectFolder)
    EndIf
EndFunc   ;==>Example
Exit

Does anyone have any suggestions, I'm lost on this...Thanks

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Maybe this can help you ?

Wow that worked a treat!

Thanks jguinch it's appreciated! :thumbsup:

Curious how did you even know that?

I'm guessing "Been there done that!!" ..lol

Edited by chrisT

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
Sign in to follow this  
Followers 0