1 / 25

Windows 7 Login Script

Windows 7 Login Script. Windows 7 Login Script. Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design Auto Login Auto Shutdown Conclusion. Introduction. The Windows 7 login script I inherited

sylvie
Download Presentation

Windows 7 Login Script

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Windows 7 Login Script

  2. Windows 7 Login Script • Introduction • The Windows 7 login script I inherited • Tools • Flow Chart • Requirements • Auto Login • Auto Shutdown • Unix Timestamps • Design • Auto Login • Auto Shutdown • Conclusion

  3. Introduction • The Windows 7 login script I inherited • Displays a login screen • Performs account authentication • Checks for blank usernames and passwords less than 8 characters • Auto login capability does not work. • Auto login implemented using threading.

  4. Introduction • Threading Thread B Thread C Thread A

  5. Introduction • Tools • Python 2.7.3 • Eclipse

  6. Flow Chart

  7. Requirements: Auto Shutdown • Shutdown the computer at any scheduled time

  8. Requirements: Auto Login • Create a 2 GB H: drive partition • Run login.vbs • Run LibraryDefaultPage.vbs • Display desktop

  9. UNIX Timestamps • Number of seconds since 12 a.m. Jan. 1, 1970 • E.g. 5/3/2013 5:54:17 PM  1362518657.85

  10. Design: auto Shutdown • Problem 1: time is not a Unix timestamp • ['11:20', ''] 1362063000.0

  11. Design: auto Shutdown • Solution: • Step 1: Get the month, day, year datetime.datetime.now() now year month day str(now.year) str(now.month) str(now.day)

  12. Design: auto Shutdown • Step 2: Get the hour, minute, second • hour,minute = shutdownTimeList[0].split(‘:’) • 11:20 • hour = 11 • minute = 20 • second = “00”

  13. Design: auto Shutdown • Step 3: Make a date string • e.g. mm/dd/YYYY HH:MM:SS • Step 4: Make a timestamp • Time.mktime.datetime.datetime.strptime(date_string, “%m/%d/%Y %H:%M:%S”) • e.g. 1362063000.0

  14. Design: Auto Login • Threading abandoned • Therefore: • shutdown –a: cancels shutdown/restart • shutdown –r –t xxx: sets restart for xxx seconds • ['1358517600000', '1358523000000', '1358527500000', '']

  15. Design: Auto Login now restart 60 sec. after auto login period time.time() • clear any restart/shutdown • create 2 GB partition for H: • call login.vbs with • auto login credentials • call LibraryDefaultPage.vbs os.system(“shutdown –r –t xxx”)

  16. Design: Auto Login now restart 60 sec. after auto login period os.system(“shutdown –a”) • clear any restart/shutdown • create 2 GB partition for H: • call login.vbs with • auto login credentials • call LibraryDefaultPage.vbs subprocess.call(“diskpart /s command.txt”) shell.Run(“wscript.exe [file path]”)

  17. Design: Auto Login • Problem: Multiple auto login times now

  18. Design: Auto Login • Solution: Boolean flag now flag

  19. Design: Auto Login • Problem: auto login after auto shutdown now auto shutdown flag

  20. Design: Auto Login • Solution: global variable autoShutdowntime now auto shutdown

  21. Design: Auto Login now auto shutdown • Summary set flag to true os.system(“shutdown –a”) os.system(“shutdown –r –t xxx”)

  22. Implementation • hour, minute = shutdownTimes[0].split(':') • dateString = month + "/" + day + "/" + year + " " + hour + ":" + minute + ":" + second • time.mktime(datetime.datetime.strptime(dateString, "%m/%d/%Y %H:%M:%S").timetuple()) • 1362063000.0

  23. Questions?

  24. Additional Material • (urllib2.urlopen("http://" + bootserver + "/getentityvarval?var=parameter").read()).split('\r\n')

  25. Introduction • Why it needs to be improved • Switch Digital Classroom to Windows 7 • Reduce power consumption • Expired and webcat accounts can log in.

More Related