Why the start directory in Button not works?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
linkun
Junior Member
Junior Member
Posts: 15
Joined: 2021-01-09, 05:40 UTC

Why the start directory in Button not works?

Post by *linkun »

Code: Select all

[em_StartPowershellISE]
cmd=%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
param=
path=%P
iconic=1
button=%COMMANDER_PATH%\User\Icons\ISE.ico
menu=Start Powershell ISE
I have specified a start directory via the argument "path" for the Total Commander? But why powershell ISE not starts with this start directory? why does this argument "path" not work?
Is it able to configure Total Commander to let the command works well as shortcuts in windows? I can easy specify a start directory for powershell ISE via a shortcut.
#359839
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6481
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Why the start directory not works?

Post by *Horst.Epp »

This button one works for me.

Code: Select all

TOTALCMD#BAR#DATA
C:\Program Files\PowerShell\7\pwsh.exe
-NoExit
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
PowerShell in current path

0
-1

And your exe works also

Code: Select all

TOTALCMD#BAR#DATA
C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe

C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe


0
-1

Using TC as admin will not work as the working dir is system32 in this case.
Windows 11 Home x64 Version 23H2 (OS Build 22631.3447)
TC 11.03 x64 / x86
Everything 1.5.0.1372a (x64), Everything Toolbar 1.3.3, Listary Pro 6.3.0.73
QAP 11.6.3.2 x64
User avatar
Stefan2
Power Member
Power Member
Posts: 4157
Joined: 2007-09-13, 22:20 UTC
Location: Europa

Re: Why the start directory not works?

Post by *Stefan2 »

linkun wrote: 2022-09-14, 10:34 UTC

Code: Select all

[em_StartPowershellISE]
cmd=%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
param=
path=%P
I have specified a start directory via the argument "path" for the Total Commander?
But why powershell ISE not starts with this start directory?
why does this argument "path" not work?



Try path="%P"

But just 'path=' would be enough as TC uses the current path as start path anyway.




 
User avatar
linkun
Junior Member
Junior Member
Posts: 15
Joined: 2021-01-09, 05:40 UTC

Re: Why the start directory not works?

Post by *linkun »

Stefan2 wrote: 2022-09-14, 12:15 UTC
linkun wrote: 2022-09-14, 10:34 UTC

Code: Select all

[em_StartPowershellISE]
cmd=%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
param=
path=%P
I have specified a start directory via the argument "path" for the Total Commander?
But why powershell ISE not starts with this start directory?
why does this argument "path" not work?



Try path="%P"

But just 'path=' would be enough as TC uses the current path as start path anyway.




 
I have tried path="%P", it still doesn't work.
But when I tried 'path=, Powershell ISE works very well. Thank you.
#359839
User avatar
nsp
Power Member
Power Member
Posts: 1804
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Why the start directory in Button not works?

Post by *nsp »

Have you used the command browser to edit your new em_ command ?
Do you run TC 64bit on a 64bit system as regular user ?

Just a try:
Use cm_CommandBrowser from command line, and on the left pane (category) chose usercmd.in on the bottom of the list.
Then edit or recreate from scratch your [em_StartPowershellISE] command.

Code: Select all

command:%windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
Start Path: .
Icon File: %windir%\system32\WindowsPowerShell\v1.0\PowerShell_ISE.exe
Tooltip: Start PowerShell ISE from current Path
then save (press OK, then OK)

Try from a button or from command line (if TC is in latest version). Target should be a regular folder or a network share (not virtual folder like \\Quick access\ or \\Desktop or any library, no FS plugin, no FTP ......)
User avatar
petermad
Power Member
Power Member
Posts: 14795
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Why the start directory in Button not works?

Post by *petermad »

Total Commander parameters %P %N %S etc. does ONLY work in the param field - not in the path or the cmd field.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Post Reply