Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automatic information (get computer IP, name, USB drive, etc
#1
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.
#2
Macro Macro1279
Code:
Copy      Help
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")
#3
You are the man!!!
#4
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:
#5
If you need to know the drive where is your QM executable
Macro Macro1282
Code:
Copy      Help
;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"


Forum Jump:


Users browsing this thread: 1 Guest(s)