Portable mode Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
dcrossmier
Posts: 3
Joined: 05 Jul 2020, 16:24

Portable mode

05 Jul 2020, 23:24

Is it possible to use AutoHotkey v1.1.33.00 in a portable manner? I mean without ANY writing to the hard drive including the registry. Writing to INI files only if necessary and should be in the AHK EXE folder.
The scenario I am after
  • Tell my friend I want to run a program from my USB memory stick. Assure him that it will make NO changes to his computer whatsoever.
  • Stick a USB stick in his computer, say it maps to X:
  • Run AutoHotkey + my script from X:
  • Use AHK ...
  • Close AHK from the tray
  • Reassure my friend again that the program I just used ONLY wrote to my USB stick, not his computer.
I have scoured the forums and found some insinuation that if I installed AutoHotkey in a different directory than the default that I may get the behavior I want. But I may be reading too much into this. ;)

I also found a PortableApps workup, but this seems unnecessary to me if the hooks exist to tell AHK to stay away from the hard drive / registry.

Thanks.
gregster
Posts: 9002
Joined: 30 Sep 2013, 06:48

Re: Portable mode  Topic is solved

05 Jul 2020, 23:46

Afaik, you just need AutoHotkey.exe to launch any .ahk-script, so that it runs from memory. Obviously, without registering the AHK extension, you will need to use the command line (with the script as a parameter) to run the script or use this feature:
https://www.autohotkey.com/docs/Program.htm#portability wrote:Renaming AutoHotkey.exe also changes which script it runs by default, which can be an alternative to compiling a script for use on a computer without AutoHotkey installed. For instance, MyScript.exe automatically runs MyScript.ahk if a filename is not supplied, but is also capable of running other scripts.
I think you can also drag-n-drop an AHK-file onto autohotkey.exe to run it (or compile your script anyway).

(So it should be possible, assuming that your script code itself is not explicitly changing anything on that computer. Of course, Windows might include the AHK script in some of its lists of recently opened files, or whatever.)
TAC109
Posts: 1111
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Portable mode

06 Jul 2020, 00:44

You could also compile your script into a self contained .exe using Ahk2Exe and ask your friend to run that.
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Portable mode

06 Jul 2020, 15:57

dcrossmier wrote:
05 Jul 2020, 23:24
Is it possible to use AutoHotkey v1.1.33.00 in a portable manner?
Yes, AutoHotkey does not need to be installed.
dcrossmier wrote:
05 Jul 2020, 23:24
  • Tell my friend I want to run a program from my USB memory stick. Assure him that it will make NO changes to his computer whatsoever.
Nope, that's impossible. Forensic artefacts are always left behind on the device. For example:

1) Enumeration of the USB memory stick will be written to several different areas of the registry (device type, vendor name and model, any serial no., USB port used, etc., including date and time) and won't be deleted even after the device is removed. These areas are sub-keys under:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USB
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR

2) The mount point, i.e. drive letter used (inc. date and time), will be written as an entry to:
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices

3) Details of the drive letter used for the USB memory stick, including date and time, will be written to the registry in a sub-key under:
HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\BagMRU\
This will identify the user.

4) Details of each 'last program used' is written (amongst other locations) to:
HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\MuiCache
This will show the drive letter of the USB memory stick and AutoHotkey.exe (including its 'bitness')... but won't show any AHK script name.

So, no... you cannot assure your friend that no changes will be made. It's just not how Windows works.

Hope this helps...
dcrossmier
Posts: 3
Joined: 05 Jul 2020, 16:24

Re: Portable mode

06 Jul 2020, 20:08

RickC wrote:
06 Jul 2020, 15:57
dcrossmier wrote:
05 Jul 2020, 23:24
Is it possible to use AutoHotkey v1.1.33.00 in a portable manner?
Yes, AutoHotkey does not need to be installed.
dcrossmier wrote:
05 Jul 2020, 23:24
  • Tell my friend I want to run a program from my USB memory stick. Assure him that it will make NO changes to his computer whatsoever.
Nope, that's impossible. Forensic artefacts are always left behind on the device.
I understand, that is fine because that is the way WinBlows works, I was talking about unnecessary I/O by AutoHotkey itself. What I have been told can be avoided. Thanks.

[Mod edit: Quote tags fixed.]
dcrossmier
Posts: 3
Joined: 05 Jul 2020, 16:24

Re: Portable mode

08 Jul 2020, 11:57

So, no... you cannot assure your friend that no changes will be made. It's just not how Windows works.
I forgot to exclude the typical Windows fluff. I meant for AHK only. Thanks for the detailed answer on what I realize now was an incomplete question! <g>
RickC
Posts: 299
Joined: 27 Oct 2013, 08:32

Re: Portable mode

08 Jul 2020, 12:23

I just answered with facts based upon your original statement. I paid no attention to anything else.... 'cos nobody can second-guess what you're trying to do.

If you want better answers, just ask better questions.
InterestingHmm
Posts: 3
Joined: 06 Apr 2023, 11:14

Re: Portable mode

06 Apr 2023, 11:17

I don't get why do I have to install it with the same installation message and "portable" option greyed out, after downloading & unpacking .zip, does this program have no portable mode?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, Joey5, RandomBoy, Rohwedder and 378 guests