We help IT Professionals succeed at work.

Date/Time Password Script

BigBobBK
BigBobBK asked
on
I need to password protect a script that stops a service (EDCSVR)on a computer.  Don't need a user name just password.  So when execcuted it should pop up input box where they can enter the password.  If correct it should pop up another box with a button to disable the service.

The password should be bassed on month, day, year, hour.  Maybe add all 4 variables then multiply by 6 and finally divide by 8.

Following is what I tried by when i enter the password in the box it does not worik.

strPasswd = ((Month(date)+Day(date)+Year(date))*6)/8
Msgbox strPasswd
password = InputBox("Enter your password:")
IF password = strPasswd THEN
Msgbox "CORRECT"
ELSE
Msgbox "INCORRECT"
END IF

Any help would be appreciated.
Comment
Watch Question

Test your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016
Commented:
You need to compare similar types, so convert the calculated numeric value to a string, as in:

strPasswd = CStr(((Month(date)+Day(date)+Year(date))*6)/8)

~bp

Author

Commented:
appreciate the help.
Bill PrewTest your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016

Commented:
Welcome.

~bp

Explore More ContentExplore courses, solutions, and other research materials related to this topic.