Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login ...
-
Upload
felipe-foden -
Category
Documents
-
view
223 -
download
1
Transcript of Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login ...
![Page 1: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/1.jpg)
WINDOWS 7 LOGIN SCRIPT
![Page 2: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/2.jpg)
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
![Page 3: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/3.jpg)
INTRODUCTION The Windows 7 login script I inherited
Displays a login screenPerforms account authenticationChecks for blank usernames and
passwords less than 8 charactersAuto login capability does not work. Auto login implemented using
threading.
![Page 4: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/4.jpg)
INTRODUCTION Threading
Thread A Thread B Thread C
![Page 5: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/5.jpg)
INTRODUCTION Tools
Python 2.7.3Eclipse
![Page 6: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/6.jpg)
FLOW CHART
![Page 7: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/7.jpg)
REQUIREMENTS: AUTO SHUTDOWN
Shutdown the computer at any scheduled time
![Page 8: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/8.jpg)
REQUIREMENTS: AUTO LOGIN Create a 2 GB H: drive partition Run login.vbs Run LibraryDefaultPage.vbs Display desktop
![Page 9: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/9.jpg)
UNIX TIMESTAMPS Number of seconds since 12 a.m. Jan. 1,
1970 E.g. 5/3/2013 5:54:17 PM 1362518657.85
![Page 10: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/10.jpg)
DESIGN: AUTO SHUTDOWN Problem 1: time is not a Unix timestamp ['11:20', ''] 1362063000.0
![Page 11: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/11.jpg)
DESIGN: AUTO SHUTDOWN Solution: Step 1: Get the month, day, year
now
datetime.datetime.now()
month
day
year
str(now.month)
str(now.day)
str(now.year)
![Page 12: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/12.jpg)
DESIGN: AUTO SHUTDOWN Step 2: Get the hour, minute, second hour,minute =
shutdownTimeList[0].split(‘:’) 11:20
hour = 11minute = 20
second = “00”
![Page 13: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/13.jpg)
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.strptim
e(date_string, “%m/%d/%Y %H:%M:%S”)
e.g. 1362063000.0
![Page 14: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/14.jpg)
DESIGN: AUTO LOGIN Threading abandoned Therefore:
shutdown –a: cancels shutdown/restart shutdown –r –t xxx: sets restart for xxx seconds
['1358517600000', '1358523000000', '1358527500000', '']
![Page 15: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/15.jpg)
DESIGN: AUTO LOGINnow
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
restart 60 sec. afterauto login period
time.time()
os.system(“shutdown –r –t xxx”)
• clear any restart/shutdown• create 2 GB partition for H: • call login.vbs with
auto login credentials• call LibraryDefaultPage.vbs
![Page 16: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/16.jpg)
DESIGN: AUTO LOGINnow restart 60 sec. after
auto login period
• clear any restart/shutdown• create 2 GB partition for H: • call login.vbs with
auto login credentials• call LibraryDefaultPage.vbs
os.system(“shutdown –a”)
subprocess.call(“diskpart /s command.txt”)
shell.Run(“wscript.exe [file path]”)
![Page 17: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/17.jpg)
DESIGN: AUTO LOGIN Problem: Multiple auto login times
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
now
![Page 18: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/18.jpg)
DESIGN: AUTO LOGIN Solution: Boolean flag
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
now
flag
![Page 19: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/19.jpg)
DESIGN: AUTO LOGIN Problem: auto login after auto shutdown
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
now auto shutdown
flag
![Page 20: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/20.jpg)
DESIGN: AUTO LOGIN Solution: global variable
autoShutdowntime
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
now auto shutdown
![Page 21: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/21.jpg)
DESIGN: AUTO LOGIN Summary
Auto Login Start Time
Auto Login Period
Auto Login End Time
Outside Auto Login Period
now auto shutdown
set flag to trueos.system(“shutdown –a”)os.system(“shutdown –r –t xxx”)
![Page 22: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/22.jpg)
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
![Page 23: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/23.jpg)
QUESTIONS?
![Page 24: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/24.jpg)
ADDITIONAL MATERIAL (urllib2.urlopen("http://" + bootserver + "/getentityvarval?
var=parameter").read()).split('\r\n')
![Page 25: Introduction The Windows 7 login script I inherited Tools Flow Chart Requirements Auto Login Auto Shutdown Unix Timestamps Design](https://reader036.fdocuments.in/reader036/viewer/2022062620/551a7c16550346b52d8b544b/html5/thumbnails/25.jpg)
INTRODUCTION Why it needs to be improved
Switch Digital Classroom to Windows 7Reduce power consumptionExpired and webcat accounts can log in.