home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cenvi23.zip
/
NEWPSWRD.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-02-12
|
2KB
|
65 lines
EXTPROC CEnvi2
//***********************************************************
//*** New Password - Use keystroke emulation to set a new ***
//*** ver.2 password. This is kind of kludgy in ***
//*** that it must know exactly what keys ***
//*** to press to get to the password page ***
//***********************************************************
Instructions()
{
puts(`NewPswrd - Set new lockup password`)
puts(``)
puts(`USAGE: NewPswrd <Password>`)
puts(``)
puts(`WHERE: Password - New lockup password`)
puts(``)
puts(`EXAMPLE: NewPswrd "blimblam"`)
puts(``)
puts(`NOTE: BE CAREFUL! Don't forget your password.`)
puts(``)
exit(EXIT_FAILURE);
}
#include <KeyPush.lib>
main(argc,argv)
{
if ( 2 != argc || !argv[1][0] )
Instructions();
Password = argv[1];
// remember active window
ActiveWindow = GetActiveWindow();
// make the desktop the active window
SetActiveWindow("Desktop");
// send the keystrokes to get the desktop settings page
KeyStroke(VK_CTRL,'\\');
KeyStroke(VK_SHIFT,VK_F10);
KeyStroke('S');
suspend(2000); // give settings page time to show itself
// get the last page of the lockup section, which is one
// page before Archive
KeyStroke('A');
KeyStroke(VK_BACKTAB);
KeyStroke(VK_LEFT);
KeyStroke(VK_ENTER);
// enter the password twice, press enter to accept
KeyStroke(Password)
KeyStroke(VK_TAB);
KeyStroke(Password)
KeyStroke(VK_ENTER);
// ALT-F4 to close the settings
KeyStroke(VK_ALT,VK_F4);
// restore original active window
SetActiveWindow(ActiveWindow);
}