Page 1 of 1

PreDefined Shortcuts - My Desktop

Posted: 25 Aug 2009, 18:53
by vld
I've tried to add My Desktop as a predefined shortcut such as Network Neighborhood or My Documents or even a Hot Path. Problem I have is if I use Salamander as a portable on my thunmbdrive, My Documents always has that path working, but My Desktop path changes from system to system.

Is there a way to make a shortcut work on what ever system you use Salamander?

Re: PreDefined Shortcuts - My Desktop

Posted: 25 Aug 2009, 22:12
by Textor
vld wrote:I've tried to add My Desktop as a predefined shortcut such as Network Neighborhood or My Documents or even a Hot Path. Problem I have is if I use Salamander as a portable on my thunmbdrive, My Documents always has that path working, but My Desktop path changes from system to system.
Is there a way to make a shortcut work on what ever system you use Salamander?
I think so - every windows installation has a predefined system variable called %USERPROFILE%.

Which contains the location of the currently logged-in users' folder, e.g.
C:\Documents and Settings\ExampleUserJohnDoe\

The Desktop of this user will be at "%USERPROFILE%\Desktop".

The problem remaining is getting Salamander to go to that path - if I enter $[USERPROFILE]\Desktop in a user-menu-entry, it is not Salamander that opens this folder, but Windows Explorer instead. And it seems that HotPaths do not accept variables as entries.

Re: PreDefined Shortcuts - My Desktop

Posted: 25 Aug 2009, 22:35
by th.
You could use a vbs script like here: http://forum.altap.cz/viewtopic.php?f=3&t=1981 in a user menu entry.

Re: PreDefined Shortcuts - My Desktop

Posted: 26 Aug 2009, 00:25
by Textor
Or use an AutoHotkey script as descibed in http://forum.altap.cz/viewtopic.php?f=4&t=3438

Code: Select all

#IfWinActive, ahk_class SalamanderMainWindowVer25

+d::
send +{F7}
sendinput %A_Desktop% {enter}
return
Using only Salamander itself for that purpose, without relying on an external program, would of course be a more elegant solution.

Re: PreDefined Shortcuts - My Desktop

Posted: 26 Aug 2009, 19:42
by vld
So I get the feeling that an external intervention needs to happen to get a PreDefined desktop shortcut to work......sounds like there is not way to get variables to work. :(

Re: PreDefined Shortcuts - My Desktop

Posted: 26 Aug 2009, 21:10
by Ether
You can add your +1 to the Hot Paths and Environmental Variables feature request. I think that's the place where your voice will be heard the most.

Re: PreDefined Shortcuts - My Desktop

Posted: 27 Aug 2009, 02:45
by vld
Thanks for pointing it out. Will have to figure out something else.

Re: PreDefined Shortcuts - My Desktop

Posted: 28 Aug 2009, 09:58
by Jan Rysavy
$(WinDir), $(SysDir), $(SalDir), $[EnvironmentVariable] variables will be supported in Hot Paths from AS 2.52.
Thank you for your ideas!

Re: PreDefined Shortcuts - My Desktop

Posted: 01 Sep 2009, 08:31
by Textor
Congratulations, it works:
$[USERPROFILE]\Desktop
can now be used as an entry for Hot Paths, and opens the current user's Desktop-Folder.

Thank You!

Re: PreDefined Shortcuts - My Desktop

Posted: 15 Sep 2009, 22:22
by vld
Jan Rysavy wrote:$(WinDir), $(SysDir), $(SalDir), $[EnvironmentVariable] variables will be supported in Hot Paths from AS 2.52.
Thank you for your ideas!
On a similar function....I've been playing around with a portable version of salamander using the BAT file posted here: http://forum.altap.cz/viewtopic.php?p=14625#p14625 I've made little modification with some error checking....just wish I could hide the command window. :oops: :oops: Anyway, I tried my Portable version on Win7. Though the Hotpaths and Variables worked, but default, I have Salamander starting in Documents and Settings in the left pane and root of a drive in the right pane. I edited the registry with a variable, ie $[HOMEPATH]\Desktop, and it always took me to My Documents. Can this be fixed for 2.53 so it will accept variables?

Re: PreDefined Shortcuts - My Desktop

Posted: 15 Sep 2009, 23:13
by Jan Rysavy
You can use command line parameters:
salamand.exe -l "%homepath%\Desktop"

Re: PreDefined Shortcuts - My Desktop

Posted: 15 Sep 2009, 23:30
by vld
Thanks...noted, but that is not as easy of loading up a generic configuration. I have converted the BAT file into a generic exe file for this portable version and all I need to do is drop a reg and exe file and salamander is portable.

Re: PreDefined Shortcuts - My Desktop

Posted: 16 Sep 2009, 07:41
by Jan Rysavy
Could you please share your "portable" version of Salamander with us?

Re: PreDefined Shortcuts - My Desktop

Posted: 16 Sep 2009, 17:45
by vld
Here you go...it's real simple. Just one file in conjunction with a REG. It's a slightly modified version of the one posted in the other topic area (I will also place this there). This is very simple to use. If you take the code below and place it within your salamander folder and run it, if the files are there, it will work. If the needed files are not there, you will get an error. Just install Salamander, drop in the CMD file, create a portsal.reg config file for salamander and then you can copy the entire folder onto a thumbdrive.

PORTSAL.CMD

Code: Select all

@echo off
Title Portable Salamander
Color 1F
if not exist portsal.reg goto :noportsal
if not exist salamand.exe goto :noportsal

:begin
if "%1" neq "" goto %1
start/min cmd /c "%~nx0 hide >nul"
goto:eof

:hide
reg export HKCU\Software\Altap %tmp%\..\SP
set el=%errorlevel%
if %el%==0 reg delete HKCU\Software\Altap /f
reg import "portsal.reg"
salamand.exe
reg delete HKCU\Software\Altap /f
if %el%==1 exit /b
reg import %tmp%\..\SP
call >%tmp%\..\SP
del %tmp%\..\SP
goto:eof

:noportsal
cls
echo.
echo.
echo              	!!!   REQUIRED FILES MISSING   !!!
echo.
echo    Two files are needed for Altap Salamander Portable Launcher
echo    to operate.  One or both are not found.
echo.
echo    1) PORTSAL.REG  - Configuration file which contains your settings
echo                      You can rename your config_.reg to portsal.reg
echo    2) SALAMAND.EXE - Executable application file
echo.
echo    Please verify that these files exist and restart the Portable Launcher
echo.
echo.
echo.
echo.
echo    Press any key to exit.
pause > nul
goto:eof