Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Command line input for username and password
Can you make a macro read a username and password from a command line?
If so, can anyone give me an example code ?
Macro UserPasswordCommandLine
Copy      Help
;Command line format:
;/u username /p password

str s=_command
;out s

ARRAY(str) a; int i
ExeParseCommandLine s a
str username password
for i 0 a.len
,;out a[i]
,sel a[i] 2
,,case ["/*","-*"]
,,sel a[i]+1
,,,case "u" i+1; username=a[i]; err
,,,case "p" i+1; password=a[i]; err

if(!username.len) end "no username"
if(!password.len) end "no password"

out username
out password

Command line to run the macro in QM:
qmcl.exe M "UserPasswordCommandLine" C /u aaaaaaaa /p bbbbbbb

Command line to run the macro converted to exe:
c:\test\UserPasswordCommandLine.exe /u aaaaaaaa /p bbbbbbb

Forum Jump:

Users browsing this thread: 1 Guest(s)