
weszzer
Active Members-
Posts
45 -
Joined
-
Last visited
weszzer's Achievements

Seeker (1/7)
0
Reputation
-
Guys, many thanks for the helps I really appreciate your effort.. Cheers
-
weszzer reacted to a post in a topic: Change Date/Time Format
-
weszzer reacted to a post in a topic: Change Date/Time Format
-
Thanks SmOke_N.. It's working as per your code. Can you explain this to me please.. "(.{10})(.)(..)(.+$)", "$1/$3") " in your code..?
-
weszzer reacted to a post in a topic: Change Date/Time Format
-
Working great mikell!!, thank you.. and thanks bonsantiago...
-
weszzer reacted to a post in a topic: Change Date/Time Format
-
that's give me: 2015-02-04--1 , "-1" if the time is the current time is between 12:00 ~ 12:59 AM it should be like 2015-02-04-00 Cheers
-
Hi there, My code below is to get the date today and the time (minus 1 hour), it's give me like; 2015/02/04 15:38:43. How to format this to 2015/02/04/15 or yyyy/mm/dd/hh only (removing the minutes and seconds) "hh" in 24hours format. #Include <Date.au3> Global $gsDayAdd = _DateAdd("h", -1, _NowCalc()) ; minus one day Global $gsDaySave= StringReplace(_DateAdd("h", -1, _NowCalc()),"/","",0,1) ;remove "/" ConsoleWrite($gsDayAdd) Thank you and regards..
-
Process Close not working on Win 2008.?
weszzer replied to weszzer's topic in AutoIt General Help and Support
Hi JohnOne, sorry didn't get what you mean. but I'm using a user with admin rights. Cheers -
Guys, I really need your help. I am having a problem on the "processclose" on Windows 2008 R2. The code below is working great on Windows 7 but not on the Windows 2008 Basically, the extract.exe is open or run by cmd.exe, after certain period of time the extract.exe will exit (automatically), then after 5sec the cmd will exit, followed by a message " File extracted" which will close after 5sec.. $PID_Check=ProcessWaitClose("extract.exe"); Pause script execution until the given process does not exist if $PID_Check = 1 Then ;1= not exist Sleep(5000) ProcessClose("cmd.exe") Sleep(3000) MsgBox(0, "", "File extracted",5); message box will close after 5sec EndIf I can't figure out what the problem is, I tried on Window 7 but no problems. I'm on domain and I'm using the same username and I able to run the code.. Is there any other code I can use to close the cmd exe. if the cmd.exe did not close, on the next run it will not execute the extract.exe since the cmd.exe is still running. This is unattended run using task scheduler. Thank you very much.
-
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
SmOke_N , thank you very much. really appreciate your help and your time. When I execute the code it opens the cmd window showing a blank screen (only a cursor while the code is processing) I can see the extract tool at the Task Manager and it's processing and using PID check, once the extract.exe finished I added to close the cmd console The code is working great.. I don't want the user to close the cmd window, it will close once the extract.exe doesn't exist on PID process.(which I added on the logic so instead I would like to send a message to a console like "please wait..." is this possible..? at the moment only the cursor is visible at the cmd console. Global $msge=("Please wait..") $PID_Check=ProcessWaitClose("exract.exe"); check if exe is in pid process if $PID_Check = 1 Then ;1=not exist Sleep(2000) ProcessClose("cmd.exe") MsgBox(0, "", "complete") ElseIf $PID_Check = 0 Then Send($msge) EndIf I found this very similar to my code but, not sure how to include this. Many thanks.. -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
Hi there.. How to convert this yyyymmdd (20150128) format? At the moment Igetting 2015/01/28 which is correct. I would also to use the data as file name but the " / " is not accepted as file namn part of the code: $gsDayAdd = _DateAdd("D", -1, _NowCalcDate()) I found this somewhere in forum. But it didn't send to cmd I like I my Send( " & $DateSave & ") Global $aDate, $aTime $DateSave=_DateTimeSplit(_DateAdd("D", -1, _NowCalcDate()), $aDate, $aTime) ; -1 (minus one day) ConsoleWrite(StringFormat( "%04s_%02s_%02s", $aDate[1], $aDate[2], $aDate[3]) & @CRLF) -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
I'm back working on this code again.Sorry my mistake. I haven't check the code properly.. Many Thanks SmOke_N -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
For some reason, the code didn't work. The extract.exe was not executed. It is not available on task manager during the process I trying to figured out what happened. Need your help please.. Thank you -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
Hi SmOke_N, Here's the complete code, it works as per the code you've given- thanks for your effort. I have question on how to make a message when the extraction is complete. I added a code to check the process (PID) if the extract.exe if not exist then it will pop-up a message that extract complete. I don't know where to insert this code I tried to put anywhere but it didn't work #include <date.au3> @YEAR & @MON & @MDAY - 1 & ".csv -D " & @YEAR & "/" & @MON & "/" & @MDAY - 1) Global $gsDayAdd = _DateAdd("D", -1, _NowCalcDate()) Global $gsCommandString = _RunBuildCommandString(@ComSpec, "/k", "extract.exe", "-I", $gsDayAdd) Global $giPID = Run($gsCommandString, "", @SW_SHOW) Global $ghCMDWnd = _getCMDWin($giPID) If @error Then ConsoleWrite("Error: " & @error & @CRLF) Exit 101 EndIf ; no need to sleep if you don't want to, you wouldn't be here if the window didn't exist ControlSend($ghCMDWnd, "", "", "{ENTER}") Func _RunBuildCommandString($sExe, $vparam1="",$vparam2="",$vparam3="", _ $vparam4="",$vparam5="", $vparam6="",$vparam7="",$vparam8="", _ $vparam9="",$vparam10=""); add more params if you need more ; check for spaces in exe string If StringRegExp($sExe, "^\s*[^\x22].*?\h") Then $sExe = '"' & $sExe & '"' EndIf Local $sCommandString, $sVal For $i = 1 To @NumParams - 1 $sVal = Eval("vparam" & $i) $sCommandString &= (StringRegExp($sVal, "^\s*[^\x22].*?\h") ? _ ' "' & $sVal & '"' : " " & $sVal) Next $sCommandString = $sExe & $sCommandString Return $sCommandString EndFunc Func _getCMDWin($iPID, $fWait = 1) $iPID = ProcessExists($iPID) If Not $iPID Then Return SetError(1, 0, 0) EndIf Local $aWList Local $iTimer = TimerInit() ; 5 minute timeout While 1 $aWList = WinList("[REGEXPTITLE:(?i).*?\bcmd\b\.exe$]") If IsArray($aWList) Then For $i = 1 To UBound($aWList) - 1 If WinGetProcess($aWList[$i][1]) = $iPID Then Return $aWList[$i][1] EndIf Next EndIf If ((TimerDiff($iTimer) / 1000) >= 300) Then ExitLoop Sleep(10) WEnd Return SetError(3, 0, 0) EndFunc My code to check if the exe file is exist: $PID_Check=ProcessWaitClose("extract.exe"); check if exe is in pid process if $PID_Check = 1 Then ;1=not exist ProcessClose("cmd.exe"); close cmd window Sleep(2000) MsgBox(0, "", "file extracted") Thank you. -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
The code is quite complicated to me :-) .. I'm still checking and testing on how and where to insert my code Now i'm stuck on this error. No variable given for "Dim", "Local", "Global", "Struct" or "Const" statement unc _RunBuildCommandString($sExe, $vparam1="",$vparam2="",$vparam3="", $vparam4="",$vparam5="", $vparam6="",$vparam7="",$vparam8="", $vparam9="",$vparam10="") Func _RunBuildCommandString($sExe, $vparam1="",$vparam2="",$vparam3="", $vparam4="",$vparam5="", $vparam6="",$vparam7="",$vparam8="", $vparam9="",$vparam10="")^ ERROR Please help.. Thank you -
Run(@ComSpec) and instead of Send Command
weszzer replied to weszzer's topic in AutoIt General Help and Support
I just came back form overseas trip. Many thanks for the help. I'll check this again. Yes, I will share and help others.. no problems. -
weszzer reacted to a post in a topic: Run(@ComSpec) and instead of Send Command
-
Date format error on new AutoIt version
weszzer replied to weszzer's topic in AutoIt General Help and Support
Thanks SmOke_N.. not sure what happened. Cheers mate.