"Create new empty file" function

English support forum

Moderators: Hacker, petermad, Stefan2, white

krypton
Junior Member
Junior Member
Posts: 13
Joined: 2013-01-24, 18:04 UTC
Location: Italy

Post by *krypton »

HolgerK wrote:
krypton wrote:1- Create an empty bat file with this string inside: copy nul "%1"
You should use "%*" to make it work.

Regards
Holger
Why? In my tests %1 works without problems.
User avatar
HolgerK
Power Member
Power Member
Posts: 5412
Joined: 2006-01-26, 22:15 UTC
Location: Europe, Aachen

Post by *HolgerK »

If i get it right you want to create a filename containing spaces.
With %1 you will get only the string until the first space.
Command line parameter are separated by space.
%1 is the first parameter
%2 is the second parameter
%* is the complete line of parameters.

Regards
Holger
Make our planet great again
krypton
Junior Member
Junior Member
Posts: 13
Joined: 2013-01-24, 18:04 UTC
Location: Italy

Post by *krypton »

HolgerK wrote:If i get it right you want to create a filename containing spaces.
With %1 you will get only the string until the first space.
Command line parameter are separated by space.
%1 is the first parameter
%2 is the second parameter
%* is the complete line of parameters.

Regards
Holger
You are right, before I tried the bat file with another instructions. Thanks, I have corrected the post.
sorcar
Member
Member
Posts: 100
Joined: 2005-04-12, 17:45 UTC
Location: U.S.

Post by *sorcar »

I have written this simple ahk script:
#IfWInActive, ahk_class TTOTAL_CMD
:*:///::
{
SendInput copy nul ""
Send {Left}
}
return
To execute, I tap left arrow in TC (that opens the run command), and press /// (that sends the string copy nul "" to the run command. I then type the filename without bothering about spaces. It is a one-finger mouse-less operation (except for the filename). For me, it works simpler than a batch file. Some others may also find it useful.
Post Reply