Pook Posted September 4, 2007 Share Posted September 4, 2007 okay, I've been playing with this all day, and surfing around. I'm trying to add time. Example: I'm trying to run a schtasks.exe right now, but you can't execute a schtask.exe task with out putting in a time. So I want the script to pull the current time, and add about 45sec, or a minute to the time & then execute. Runwait ("schtasks.exe /create /tn Test /tr " & $ListPick & " /sc once /st " & $ptime & " /s "& $InputData) This is the code that is not working..... I can't find a way to add to the $ptime. $ptime = GUICtrlRead($n) + ???????????? #include <GUIConstants.au3> GUICreate("time") If @UNICODE Then $DTM_SETFORMAT = 0x1032 Else $DTM_SETFORMAT = 0x1005 Endif $style = "HH:mm:s" $n=GUICtrlCreateDate ( "", 20, 20, 100, 20, $DTS_TIMEFORMAT) GuiCtrlSendMsg($n, $DTM_SETFORMAT, 0, $style) $time = GUICtrlRead($n) MsgBox(0,"Time",$time) $ptime = GUICtrlRead($n) MsgBox(0,"Time 2",$ptime) ANY IDEAS???? Link to comment Share on other sites More sharing options...
is8591 Posted September 4, 2007 Share Posted September 4, 2007 Check _DateAdd function. you may have to reformat the value read from control Link to comment Share on other sites More sharing options...
Pook Posted September 5, 2007 Author Share Posted September 5, 2007 I ended up doing this... (It might be the long way, but it works) it adds 1:15 to the current time. #include <GUIConstants.au3> GUICreate("time") If @UNICODE Then $DTM_SETFORMAT = 0x1032 Else $DTM_SETFORMAT = 0x1005 Endif $styleh = "HH" $style = "mm" $n=GUICtrlCreateDate ( "", 20, 20, 100, 20, $DTS_TIMEFORMAT) $h=GUICtrlCreateDate ( "", 20, 20, 100, 20, $DTS_TIMEFORMAT) GuiCtrlSendMsg($h, $DTM_SETFORMAT, 0, $styleh) GuiCtrlSendMsg($n, $DTM_SETFORMAT, 0, $style) $time = GUICtrlRead($n) $ptime = GUICtrlRead($n)+1 $htime = GUICtrlRead($h) $ftime= $htime & ":" & $ptime & ":" & "15" MsgBox(0,"time4", $ftime) Link to comment Share on other sites More sharing options...
randallc Posted September 5, 2007 Share Posted September 5, 2007 Hi Or; #include <date.au3> MsgBox(0,"$sNewTime", StringRight(_DateAdd( 's',75, _NowCalc()),8))Best, Randall ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Pook Posted September 5, 2007 Author Share Posted September 5, 2007 Okay... that is much easier!!!!! Link to comment Share on other sites More sharing options...
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