I created a script to auto log in the program. At the first few steps, I use input command to get variables of the username and password, etc. and then rest of the script will go to a loop. How to only ask the user input the username and password only once, and it will "hard-coded" the info into the compiled script, so the user do not need to input the info again when they run the compiled macro next time.
thanks for your kindly help!
input variable only once into the compiled macro?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
When you compile the script you can enter any vars into the "Include Parameters" section of the compiler dialog, e.g:
/username=user1 /password=secret
/username=user1 /password=secret
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
I think this means have each user run the compiled macro, enter their username/pw only the first time and store it. Seems like a bad idea to me but if it doesn't violate any security procedures you could save the username/pw encrypted in an external file. Look at the help for Crypt>. Check for the existence of the password file when the macro starts. If it doesn't then run the pw input command or dialog, otherwise retrieve the info from the file and run the rest of the macro.
Hi joe88888,
1) Your user runs the compiled macro
2) The macro checks for the existence of a certain file on their hard drive that contains their username and password (the first time the macro runs, the file will not be there)
3a) If it does not find that file, it should ask the user to enter their username and password and then write a file to their hard drive that contains that information
3b) If it does find the file, it can read the file to pull in the user name and password
4) Macro would continue normally after this
As Me_again suggests, you could use the Crypt> command to encrypt the username and password data before writing the file and to decrypt it when you need to read it.
You do not need to know the user's name and password.joe88888 wrote:Me_again, that is what I meant. Security is not a issue. but I do not know the user's user name and password in your suggestion.
1) Your user runs the compiled macro
2) The macro checks for the existence of a certain file on their hard drive that contains their username and password (the first time the macro runs, the file will not be there)
3a) If it does not find that file, it should ask the user to enter their username and password and then write a file to their hard drive that contains that information
3b) If it does find the file, it can read the file to pull in the user name and password
4) Macro would continue normally after this
As Me_again suggests, you could use the Crypt> command to encrypt the username and password data before writing the file and to decrypt it when you need to read it.
jpuziano
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -
Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post -