本帖最后由 highflybird 于 2011-10-12 23:29 编辑
你可以利用shell命令,修改时间和日期:
或者更高级一点的:
- (vl-load-com)
- (defun C:CDT (/ item WMI COM SYS)
- (setq WMI (vlax-create-object "WbemScripting.SWbemLocator"))
- (setq COM (vlax-invoke WMI 'ConnectServer))
- (setq SYS (vlax-invoke COM 'ExecQuery "Select * from Win32_OperatingSystem"))
- (vlax-for item SYS
- ;UTC时间格式 (例如:2011-10-12 18:25:08 UTC+08:00)
- (vlax-invoke item 'SetDateTime "20111012182508.000000+480")
- )
- (vlax-release-object COM)
- (vlax-release-object SYS)
- (vlax-release-object WMI)
- (princ)
- )
不过对于windows 7 或者vista 需要开启UAC。
|