Start menu: %temp% in Parameters causes %T (target)

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Guillaume
Junior Member
Junior Member
Posts: 90
Joined: 2003-04-08, 16:51 UTC

Start menu: %temp% in Parameters causes %T (target)

Post by *Guillaume »

Well, sorry I bumped an old topic, icfu suggested I'd make a new topic, so here it is:

I want to make an item in the start menu that parses the selected items as a m3u playlist to foobar2000. For foobar200, this can simply be done by "foobar2000.exe playlist.m3u" as commandline.

Now because foobar2000 will not recognize the extension .tmp of the "%L" file list (it could directly be used as a playlist for that matter), I wanted to make sure it's renamed to playlist.m3u. This should be done by the following I guessed:

Command: cmd.exe
Parameters: /c copy /y "%L" "%temp%\playlist.m3u" & start e:\multimedia\foobar2000\foobar2000.exe "%temp%\playlist.m3u"

So it should copy the list file to playlist.m3u in the temp directory. But what happens is that a file called "empplaylist.m3u" is created in the target directory (which should be specified as %T in Total Commander).

It doesn't matter whether I use "%TEMP%" ("%TMP%") or "%temp%" ("%tmp%").

I tried TC 6.52.

P.S. It could be a nice option to specify the extension of the list file, using something like "%L[m3u]" or "%L[txt]" as parameter, to deal with problems like this :wink:
User avatar
nevidimka
Senior Member
Senior Member
Posts: 385
Joined: 2004-06-20, 21:38 UTC

Post by *nevidimka »

2Guillaume
In "Parameters" you cann't use environment variables directly. In your case double % would help.
Parameters: /c copy /y "%L" "%temp%\playlist.m3u" & start e:\multimedia\foobar2000\foobar2000.exe "%temp%\playlist.m3u"
change this to

Code: Select all

Parameters: /c copy /y "%L" "%%temp%%\playlist.m3u" & start e:\multimedia\foobar2000\foobar2000.exe "%%temp%%\playlist.m3u"
The doorstep to the temple of wisdom is a knowledge of our own ignorance. Benjamin Franklin
User avatar
Guillaume
Junior Member
Junior Member
Posts: 90
Joined: 2003-04-08, 16:51 UTC

Post by *Guillaume »

Thanks a lot, I couldn't find this anywhere in the helpfile, and probably used the wrong keywords here, sorry about that. Case closed ;)
User avatar
Hacker
Moderator
Moderator
Posts: 13064
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

I couldn't find this anywhere in the helpfile
From Change start menu Help:
%% inserts the percent-sign.
;)

HTH
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Guillaume
Junior Member
Junior Member
Posts: 90
Joined: 2003-04-08, 16:51 UTC

Post by *Guillaume »

My God I'm so blind :oops: Thanks anyway :) Works like a charm now.
tresi
Junior Member
Junior Member
Posts: 2
Joined: 2016-11-24, 08:41 UTC
Location: Germany

Post by *tresi »

Long time ago, but I have the same problem here and it is not working with a double percent sign.

I want to call a Autohotkey-Script from %APPDATA%\GHISLER\Scripts folder.

After adding a start menu entry with the command "%APPDATA%\GHISLER\Tools\Autohotkey\AutoHotkeyU64.exe" (this works) I tried the following parameters with this results:

"%APPDATA%\GHISLER\Scripts\myscript.ahk"
Script file not found
{SOURCE PATH}\PPDATAGHISLER\Scripts\myscript.ahk

"%%APPDATA%%\GHISLER\Scripts\myscript.ahk"
Script file not found
{SOURCE PATH}\%APPDATA%\GHISLER\Scripts\myscript.ahk

What is the problem?

Thanks a lot in advance.

Kind regards,
tresi
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

You can only use %%-enclosed envvars in parameters field if target application supports them (because they are passed as is), and it seems that AutoHotkeyU64.exe doesn't expect envvars there.

You can pass script in command field, e.g.:

Code: Select all

Command: "%APPDATA%\GHISLER\Tools\Autohotkey\AutoHotkeyU64.exe" "%APPDATA%\GHISLER\Scripts\myscript.ahk"
Parameters: <other parameters>
tresi
Junior Member
Junior Member
Posts: 2
Joined: 2016-11-24, 08:41 UTC
Location: Germany

Post by *tresi »

That simple!? ;-)

I didn't know that the command can contain parameters.

Thank you very much. That's it :-)

Kind regards,
tresi
Post Reply