Is there a way to run AHK resident on a USB device. Here is my scenario:
I have a KVM that allows the sharing of a USB device (stick or drive) that is plugged into the back of the KVM switch. That is, when the position one is selected, whatever USB device is plugged into the back of the KVM switch, I can access that drive from computer one. But, when I switch the KVM to computer 2, I still have access to the USB device plugged into the KVM device (acts as a shared storage device, or network drive, if you will).
Is there any way to get AHK to run on the USB device so that I have access to its use when on either machine (1 or 2)?
Thanks.
Running AHK resident on a USB device?
- JoeWinograd
- Posts: 2198
- Joined: 10 Feb 2014, 20:00
- Location: U.S. Central Time Zone
Re: Running AHK resident on a USB device?
Unpack the AHK download and copy it to a folder on the USB drive. Then simply run it from there. For example, if the USB drive comes up as the F drive and the folder where you copied the unpacked AHK files is AutoHotkey and the folder where you have the scripts on the USB drive is MyScripts, then do this...
F:\AutoHotkey\AutoHotkeyA32.exe F:\MyScripts\ScriptFileName.ahk parameters
or
F:\AutoHotkey\AutoHotkeyU32.exe F:\MyScripts\ScriptFileName.ahk parameters
or
F:\AutoHotkey\AutoHotkeyU64.exe F:\MyScripts\ScriptFileName.ahk parameters
...depending on which version of AHK you want to use. Regards, Joe
F:\AutoHotkey\AutoHotkeyA32.exe F:\MyScripts\ScriptFileName.ahk parameters
or
F:\AutoHotkey\AutoHotkeyU32.exe F:\MyScripts\ScriptFileName.ahk parameters
or
F:\AutoHotkey\AutoHotkeyU64.exe F:\MyScripts\ScriptFileName.ahk parameters
...depending on which version of AHK you want to use. Regards, Joe
Re: Running AHK resident on a USB device?
test script with msgbox to show the last 2 drives
a part from my script , which I used to copy a folder from computer to USB (C>D) and then copy from USB to another computer (E>D)
a part from my script , which I used to copy a folder from computer to USB (C>D) and then copy from USB to another computer (E>D)
Code: Select all
drivegetshow:
i=0
alldrives:=""
DriveGet, A, List,
StringSplit,D, A,
loop,%d0%
{
DRV:= % d%a_index% . ":\"
i++
DriveGet , type1 , type , %DRV% ;- removable / fixed
DriveGet , cap1 , capacity , %DRV%
DrivespaceFree , free1 , %DRV%
DriveGet , fs1 , fs , %DRV% ;- FAT
DriveGet , label1 , label , %DRV% ;- volume label >\\server1
DriveGet , serial1 , serial , %DRV% ;- volume serial number
DriveGet , status1 , status , %DRV%
alldrives .= drv . " "
msgbox, 262208,Drive-Info_%i% ,%DRV% %type1% %label1% %fs1% %cap1%-MB %free1%-MB %status1%
}
VT:=D0 ;- totaldrives
VL:=(D0-1) ;- totaldrives-1
last = %drv%
loop,%vl%
secondlast := % d%a_index% . ":\"
msgbox,TotalDrives=%vt%`nALL=%alldrives%`n------------------`nSecondlast=%secondlast%`nLast=%drv%
; drv is the last drive
64bit:=a_is64bitOs
if (64bit=0)
msgbox, %drv%AutoHotkey\AutoHotkeyU32.exe "%drv%MyScripts\ScriptFileName.ahk"
else
msgbox,%drv%AutoHotkey\AutoHotkeyU64.exe "%drv%MyScripts\ScriptFileName.ahk"
return
Who is online
Users browsing this forum: Google [Bot], Rohwedder and 422 guests