Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SecureCRT script for changing date and time

Status
Not open for further replies.

Skaret

Technical User
Jan 17, 2004
244
NO
Hi all!

I'm looking for a script that changes the time and date on a CS1K based on the time and date on my PC. Using SecureCRT from VanDyke.
 
Code:
integer iDay, iMonth, iYear, iMin, iHour, iSec
   string sSend
  
   ltimeints $LTIME iYear iMonth iDay iHour iMin iSec
   
   strfmt sSend "STAD %02d %02d %d %02d %02d %02d" iDay iMonth iYear iHour iMin iSec
 transmit "ld 2^M"
   waitfor "."
   transmit "TTAD^M"
   waitfor "."
   transmit sSend
   transmit "^M"
   waitfor "."
   mspause 20
   transmit "TTAD^M"
   waitfor "."
   mspause 20
   transmit "****^M"

that's the ascept version, paste that into your editor and let me know what errors you get.. i've got to look into vandyke, a lot of request for help for the new kid on the block..

i have sent working aspect scripts to users who managed to convert the syntex..



john poole
bellsouth business
columbia,sc
 
This should do it...

Code:
Sub Main
	crt.Sleep 1000 
	crt.Screen.Send "****" & chr(13)
	crt.Screen.WaitForString ">"
	crt.Screen.Send "ld 2" & chr(13)
	crt.Screen.WaitForString "."
	crt.Screen.Send "ttad"
	crt.Sleep 1000 
	crt.Screen.Send ("stad " & Day(Now()))
	crt.Screen.Send (" " & Month(Now()))
	crt.Screen.Send (" " & Year(Now()))
	crt.Screen.Send (" " & Hour(Now()))
	crt.Screen.Send (" " & Minute(Now()))
	crt.Screen.Send (" " & Second(Now())) & chr(13)
	crt.Screen.WaitForString "."
	crt.Sleep 1000
	crt.Screen.Send "ttad"
	crt.Sleep 1000
	crt.Screen.Send "****" & chr(13)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top