Jump to content

F8LDXSL4P

Members
  • Posts

    14
  • Joined

  • Last visited

F8LDXSL4P's Achievements

  1. I figured it out! I had to create a task based on the XML template and then change the time to what i want. Didn't ask for the password when i changed the time but didnt change it from "Run only when user is logged in" to "Run whether user is logged in" either! @jdelaney: I needed it to run as the "foradmin" user as the task is launching a screenshot program and it wouldn't capture the user's desktop unless the "Run only when user is logged in" was selected. Thanks for all your help guys! Heres the solution code $sNewDate2 = _DateAdd('n', 2, _NowCalc()) $timesplit2 = StringSplit($sNewDate2, " ") $schtask = 'schtasks /create /XML template.xml /tn TASK' $schtask2 = 'schtasks /change /tn TASK /st ' & $timesplit2[2] $schtask3 = 'password' $wbpid = RunAs("foradmin", @ComputerName, "password", "", "C:\Windows\system32\cmd.exe", @SystemDir, @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($wbpid, $schtask) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid, $schtask2) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid, $schtask3) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid)
  2. So i tried this code.. Problem is it doesn't ask for the password and goes through successfully but still doesn't change the Run as logged user option. If i manually open command prompt and put the /change command in there it will ask for it.. Strange #include <Date.au3> #include <Constants.au3> $sNewDate = _DateAdd('n', 2, _NowCalc()) $timesplit = StringSplit($sNewDate, " ") $schtask = 'schtasks /create /ru foradmin /rp password /sc once /st ' & $timesplit[2] & ' /tn TASK /tr notepad.exe' $schtask2 = 'schtasks /change /ru foradmin /tn Task /it' $schtask3 = 'password' $wbpid = Run("C:\Windows\system32\cmd.exe", @SystemDir, @SW_SHOW, $STDIN_CHILD + $STDOUT_CHILD) StdinWrite($wbpid, $schtask) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid, $schtask2) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid, $schtask3) StdinWrite($wbpid, @CRLF) StdinWrite($wbpid)
  3. If I use schtasks /change /ru foradmin /rp password /tn Task /it ... it will say SUCCESS: The scheduled task "Task" has been changed but does not change it to "Run as logged user". Darn Windows bug EDIT Another thing i tried is this: schtasks /create /XML template.xml /tn TASK Works, Run as logged user.. Then did this: schtasks /change /ru foradmin /rp password /tn TASK /st 3:00:00 with and without /it Success, but changed it from Run as logged user to Run whether user is logged in or not...
  4. I would like to use that but how do i get around the password argument? @jdelaney: Ive tried going the XML route and it does import "Run as logged user", but i have to enter the password (like pic above) to change the Start time. I tried changing the time with /st when creating a task with the XML but the /st parameter is not allowed when using XML import
  5. I take it that using Send commands is probably the best solution to this issue?
  6. Hello im trying to schedule a task in task scheduler that will "Run Only When User Is Logged In" ... Seems easy since you just add /IT into the schtasks /create command line.. problem is this is a bug/glitch in windows. Since doing a schtasks /change /ru username /tn Task /IT will fix it, the problem is it will ask for the password after sending the command. How can i also send the password with the change command?? Ive tried using the following code: Run("C:\WINDOWS\system32\cmd.exe", "") WinWaitActive("C:\WINDOWS\system32\cmd.exe") $ssmessage1 = 'schtasks /change /tn TASK /it' $ssmessage2 = 'password' $ssmessage3 = 'exit' WinActivate("C:\WINDOWS\system32\cmd.exe") Send($ssmessage1 & "{ENTER}") WinActivate("C:\WINDOWS\system32\cmd.exe") Send($ssmessage2 & "{ENTER}") WinActivate("C:\WINDOWS\system32\cmd.exe") Send($ssmessage3 & "{ENTER}") Exit But doesn't really work the best. Is there a better way to do this? Thanks
  7. I sometimes get a Line 10 Error: "Variable must be of type "Object" with the USB Backup Script. Anyone else get this?
  8. I cant find a topic about it, only simulating.
  9. Is there a way to have to have a hotkey or use _IsPressed to start a func/program when the mouse is left clicked so many times within a certain time limit? Thanks
  10. I suppose that would work too.. This script will be run on multiple computers (more like 1,000). Is there a way to combine TXT sheets into a list on one sheet or excel document? Theres a chance multiple computers would run this at the same time so I can't really have them take the same txt file and write to it and upload it back.. would have to have them upload a thier own txt to avoid "file in use" errors EDIT: Nvm, that was an easy find. Thanks for the help!
  11. It is it possible to have a script write to a Text file via HTTP if it had Read/Write/Execute Permisions or 777 on the text file on the server?? Tried this, had no errors but didnt work $Notify = "http://something.com/example.txt" FileWriteLine($notify, @ComputerName)
  12. I just added the /IT to my task scheduler command but the image is still hidden. Here is my command to schedule: $AddTN = "schtasks /Create /TN IDS /SC Once /ST 03:45 /SD " & $sDay & " /TR C:\KAST\IDS\data\IDScal.exe /IT" RunWait(@ComSpec & " /c " & $AddTN, @WindowsDir, @SW_HIDE)
  13. Its a user with administrator rights
  14. I have task scheduler scheduled to run a script that contains "SplashImage" but it is keeping the program hidden and image never appears when launched.. Task is setup to "Run only when user is logged in" Any help would be appreciated! Thanks
×
×
  • Create New...