Jump to content

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


Go to solution Solved by jguinch,

Recommended Posts

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...