Falling Posted November 3, 2004 Share Posted November 3, 2004 (edited) Sorry, if not could someone give me some tips on how to start a project like this? What i would want to do is use a function that you enter a parametor like ChangeTime(10, 5, 1985, 4:50pm). The call to that function would set the calendar in windows to 10/5/1985 at 4:50pm) The exact time part is not that important really. It's mainly changing the date. Edited November 3, 2004 by Falling Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 If you are willing to change (or parse) the date and time format, you could write a function that wraps the DOS "Date" and "Time" functions. Maybe someone else knows a better way. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Falling Posted November 3, 2004 Author Share Posted November 3, 2004 Could you expand on what you said? Like give more meat and less bone? What you said kind of went over my head. If you change DOS time windows time changes also? Link to comment Share on other sites More sharing options...
Developers Jos Posted November 3, 2004 Developers Share Posted November 3, 2004 (edited) Could you expand on what you said? Like give more meat and less bone? What you said kind of went over my head.If you change DOS time windows time changes also?<{POST_SNAPBACK}>Run(@comspec & " /c date 01/01/2004") will change the date to jan 1, 2004so all you need to do is do run commands for date and time to accomplish what you want. Edited November 3, 2004 by JdeB SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 At least in 2000/XP the DOS prompt is just emulated. This means that DOS gets its time from Windows. Using the Run (AutoIt) command you could execute "Time time to change to" and "Date date to change to" You can find more on this on the internet. Just google the DOS "Date" and "Time" commands. Or you can always just try it... go to the command prompt and type in "Date /?" and "Time /?". This will give you the help provided for these commands.*** Matt @ MPCS Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 (edited) Consider using http://www.softshape.net/download/cmdtime.zipcmdtime3 for a nice command line apps that sets the clock perfectly.Edit: oh... I had the clock wrong for 2 seconds!! Thanks cmdtime3. Edit2: time is only one per system. Worry not Falling.Most probably it is even shared between OS. Edited November 3, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 (edited) Consider using cmdtime3 for a nice command line apps that sets the clock perfectly.How does this differ from the intrinsic commands provided by windows?ADDITION: Nevermind, I figured it out. Depending on the situation you are setting the date and time for, this could or may not be useful. It requires an internet connection, and in his example above:ChangeTime(10, 5, 1985, 4:50pm) Edited November 3, 2004 by Matt @ MPCS Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 1. That not all Windows have it. 2. Easy of use. Why use a whole service for a so simple thing? 3. Who care? I like it. Link to comment Share on other sites More sharing options...
Falling Posted November 3, 2004 Author Share Posted November 3, 2004 actually i think that compec line will be exactly what i need. I need to change dates randomly actually. Date will change months at a time in my program to determain APR Rates and such. Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 Lemme think... Time limited programs? Link to comment Share on other sites More sharing options...
Falling Posted November 3, 2004 Author Share Posted November 3, 2004 (edited) Here it is the function i was asking for. Thanks for all your suggestions. But especially to JdeB for the excelent 1 line command and to Matt @ MPCS for explaining how it works. Func ChangeDateStupidComputer($M, $D, $Y) Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y &"") EndFunc ChangeDateStupidComputer("2","3","1981") This is prob a good method, because now i can make a ChangeTimeStupidComputer that is independent. -------------------- If only i could get that crazy dos box from popping up. Even if it is for only a split secound. Edited November 3, 2004 by Falling Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 I have personally had problems with it but you could try setting the "flag" parameter of the Run command. Set it to @SW_HIDE. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Developers Jos Posted November 3, 2004 Developers Share Posted November 3, 2004 If only i could get that crazy dos box from popping up. Even if it is for only a split secound.<{POST_SNAPBACK}>Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y, "", @SW_HIDE) SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 (edited) What about? Func ChangeDateStupidComputer($M, $D, $Y) Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y,'',@sw_hide) EndFunc ChangeDateStupidComputer("2","3","1981")] Actually Matt was the first with the date idea... Edited November 3, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 Wow. Three answers at the same time! Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 I was with the @SW_HIDE idea too... but it doesn't matter as long as he gets help. *** Matt @ MPCS Link to comment Share on other sites More sharing options...
Falling Posted November 3, 2004 Author Share Posted November 3, 2004 ==> Unable to execute the external program.: Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y &"", @SW_HIDE) The directory name is invalid. Guess for WinXP this @SW_HIDE does not work? Link to comment Share on other sites More sharing options...
ezzetabi Posted November 3, 2004 Share Posted November 3, 2004 (edited) Guess you can't copy and paste.TryRun(@comspec & " /c date " & $M &"/"& $D &"/"& $Y &"","", @SW_HIDE) Edited November 3, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
Matt @ MPCS Posted November 3, 2004 Share Posted November 3, 2004 (edited) You miscopied their code, it is: Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y[b], "",[/b] @SW_HIDE) *** Matt @ MPCS EDIT: Damn I was late on that one Edited November 3, 2004 by Matt @ MPCS Link to comment Share on other sites More sharing options...
Developers Jos Posted November 3, 2004 Developers Share Posted November 3, 2004 ==> Unable to execute the external program.: Run(@comspec & " /c date " & $M &"/"& $D &"/"& $Y &"", @SW_HIDE) The directory name is invalid.Guess for WinXP this @SW_HIDE does not work?<{POST_SNAPBACK}>look at what is posted and your code... it is different !! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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