commandline parameter issues

Get help with using AutoHotkey and its commands and hotkeys
User avatar
BGM
Posts: 495
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

commandline parameter issues

07 Mar 2020, 14:32

I'm having a problem with the commandline.

Here is the simple script:

Code: Select all

#singleinstance force
#noenv

Loop, %0%  ; For each parameter:
{
    param := %A_Index%  ; Fetch the contents of the variable whose name is contained in A_Index.
    MsgBox, 4,, Parameter number %A_Index% is %param%.  Continue?
    IfMsgBox, No
        break
}
I am dropping an file onto the ahk script, and the path has a space in it.
c:\somfolder\other folder\file.jpg

The script interprets this as two files, providing two messageboxes for the same file:
Parameter number 1 is A:\somefolder\other. Continue?
Parameter number 2 is folder\AspergesCard.png. Continue?

AutoHotkey 1.1.32.00 Unicode 32-bit on Windows 10.1909 Pro x64

I've tried this too:

Code: Select all

for n, param in A_Args  ; For each parameter:
{
    MsgBox Parameter number %n% is %param%.
}
Parameter number 1 is A:\Liturgicon\Asperges.
Parameter number 2 is Card\AspergesCard.png.

Am I missing something? This used to work on my Windows 7.
User avatar
BGM
Posts: 495
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: commandline parameter issues

07 Mar 2020, 14:36

Ah, okay, so maybe 8-dot-3 names are turned off on my system? It works if I compile the script, though.

Aside from this, is there any reason NOT to enable the 8-dot-3 filenames on Win10?
TAC109
Posts: 595
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: commandline parameter issues

07 Mar 2020, 16:17

There’s a very small performance penalty having 8dot3 switched on. It is needed on for the system disk (partition)

There’s a registry setting for 8dot3 fully on, fully off, or use-per-disk setting. Your system is probably set to the use-per-disk setting. (I can’t remember the command off the top of my head - google it.)

Edit:
You can confirm this from an administrator DOS prompt by typing fsutil 8dot3name query D: (where D: is your drive letter) and pressing enter. You’ll probably find that 8dot3names are enabled on the C drive and disabled on the other drive. You can set 8dot3names on all your drives by typing fsutil 8dot3name set 0 and pressing enter. This will cause 8dot3names to be created for all new files on your drives, but you’ll need to recreate the files on this drive to create their short names (e.g. by copying the containing folder to a new folder). You can check the short names in a folder by typing dir /x <folder name> and pressing enter. Note that there will be no short name created if the long name fits the short name model.

Edit2: fix typo
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
User avatar
BGM
Posts: 495
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: commandline parameter issues

07 Mar 2020, 21:08

Thanks for the explanation.

I did run the fsutil command already after I made my last post, but didn't realize I had to recreate the files to get it to work.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], hasantr, mikeyww, sadasada, Syzygy and 59 guests