Posts: 14
Threads: 4
Joined: May 2008
I would like to use a QM exectable on a key drive, that when activated on a PC would automatically store the: Ip address' PC name and date/time to a text file. Any help would br greatly appreciated. Thanks in advance.
Posts: 11,899
Threads: 138
Joined: Dec 2002
Macro
Macro1279
str ip pcname datetime s
GetIpAddress "" ip
GetUserInfo &pcname 1
datetime.timeformat
s.format("IP=%s[]Computer=%s[]Time=%s" ip pcname datetime)
;out s
s.setfile("$desktop$\textfile.txt")
Posts: 14
Threads: 4
Joined: May 2008
Posts: 14
Threads: 4
Joined: May 2008
Yikes, one more step. Since I will be running this script from a key drive, and calling an executable file from such, is their a default I can use in my script that will automatically recognise the keydrive I just plugged in on the host machine? In otherwords, I will be using this keydrive on many differant machines. Each machine would recognize the keydrive with a differant letter (E, F, G) dependant on how many drives the computer already has. Does this make any sense? :roll:
Posts: 11,899
Threads: 138
Joined: Dec 2002
If you need to know the drive where is your QM executable
Macro
Macro1282
;add this somewhere at the beginning
str+ g_mydrive.left(_qmdir 2)
SetEnvVar "mydrive" g_mydrive
;then anywhere in your macro you can use g_mydrive. Example:
out g_mydrive
;also, anywhere in your macro with QM file functions you can use %mydrive% as your drive name. Example:
run "%mydrive%\folder\some.exe"