Do user commands support relative paths?
Moderators: fgagnon, nikos, Site Mods
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
Try a user command like
>"%x2path%editor2_UC.exe"
Removing the \ after the second % in case the extra \ is screwing things up...
my x2 path has no spaces... but I will test that now...
a question for sanity sake: do you have editor2_UC.exe in the x2 folder?
That >editor2_UC.exe works just means the x2 folder is in the path, or the x2 folder is the is in the active pane/tab. That would not be the case if you are trying to do this from a USB key and browsing other folders.
>"%x2path%editor2_UC.exe"
Removing the \ after the second % in case the extra \ is screwing things up...
my x2 path has no spaces... but I will test that now...
a question for sanity sake: do you have editor2_UC.exe in the x2 folder?
That >editor2_UC.exe works just means the x2 folder is in the path, or the x2 folder is the is in the active pane/tab. That would not be the case if you are trying to do this from a USB key and browsing other folders.
Last edited by FrizzleFry on 2008 Apr 16, 20:18, edited 1 time in total.
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
It actually worked for me with an x2 path with spaces with or without quotes and also with or without the extra \
To fgagnon: this discussion should probably be split off to its own thread, we have gotten pretty far from "backup or transfer your settings". I would say at desslok's first post. Thanks.
To fgagnon: this discussion should probably be split off to its own thread, we have gotten pretty far from "backup or transfer your settings". I would say at desslok's first post. Thanks.
I believe your "fix" will stop working once you execute any program from within XPLORER2 that will cause it to change the CWD somewhere else.desslok wrote: Edit:This worksCode: Select all
>editor2_UC.exe
To check, press F10 [enter] and see what the current path is when you first start up XPLORER2. The CWD should be the directory where the XPLORER2 exe file is located.
Now, close that command window, navigate to any file with a program association (.DOC, .XLS, .PDF, etc.) and press [enter] to execute the program on that file. From XPLORER2, presss f10 [enter] again and the CWD should now be the directory where the file or program is located, e.g. "C:\Documents and Settings\{username}\My Documents" if you opened a document from your My Documents folder.
Using Fizz's suggestion to remove the extra "" from your command line should correct the problem permanently.
Ahhhh, reminising over the BATCH "programming" language - takes me back to when real programmers knew just how much could be done with the FOR command and redirection....
PJ in (sunny) FL
"The hardest thing to admit is what you don't know"
"The hardest thing to admit is what you don't know"
This "fix" continues to workpj wrote:I believe your "fix" will stop working once you execute any program from within XPLORER2 that will cause it to change the CWD somewhere else.
No, that didn't do anything. The problem is, as FrizzleFry pointed out, I was doing it from the installed version :Dpj wrote:Using Fizz's suggestion to remove the extra "" from your command line should correct the problem permanently.
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
That you are running from the install folder is not a problem. This method should work. But it's probably why your fix works. Your fix most likely will not work if you are running x2 from a USB key on a system that does not have x2 installed.
What version of x2 are you running?
Is editor2_UC.exe is this folder: C:\Program Files\zabkat\explorer2\?
Do you have editor2_UC.exe is a folder that is in your PATH?
What version of x2 are you running?
Is editor2_UC.exe is this folder: C:\Program Files\zabkat\explorer2\?
Do you have editor2_UC.exe is a folder that is in your PATH?
Last edited by FrizzleFry on 2008 Apr 17, 16:19, edited 1 time in total.
It works. But user command is different from the one you suggested earlier.FrizzleFry wrote:That you are running from the install folder is not a problem. This method should work.
1.7.1.2What version of x2 are you running?
Yes.Is editor2_UC.exe is this folder: C:\Program Files\zabkat\explorer2\?
Look at my post above.Do you have editor2_UC.exe is a folder that is in your PATH?
Code: Select all
2path=C:\Program Files\zabkat\explorer2\
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09
I tried your fix and it works!
x2 seems to look in its folder for user command executables. Nikos will have to confirm that. If this is the case then the whole batch file thing is unnecessary.
I have tried it with a few programs (other than editor2) and it works
The real test would be to try it from a USB key with the portable version but I do not have it either.
x2 seems to look in its folder for user command executables. Nikos will have to confirm that. If this is the case then the whole batch file thing is unnecessary.
I have tried it with a few programs (other than editor2) and it works
The real test would be to try it from a USB key with the portable version but I do not have it either.
-
- Silver Member
- Posts: 281
- Joined: 2006 Dec 29, 12:56
- Location: Utrecht, NL
Wow! Lately I've been hurting my brain how issue User Commands from x2 portable that refer to other executables also on my usb drive, with the ever changing drive letters. This works! I didn't know the path set in a batch file to start up x2 is passed to x2 itself. Great!
I would use %~d0 (instead of %~dp0) in the pathsetting though, this makes it easier to construct paths to executables in sibling folders of the x2 install folder. %~d0 refers to the drive letter from which the batch file is run.
Still I would like it, if possible, to have some $-token to refer to the x2 installation-drive or path :)
I would use %~d0 (instead of %~dp0) in the pathsetting though, this makes it easier to construct paths to executables in sibling folders of the x2 install folder. %~d0 refers to the drive letter from which the batch file is run.
Still I would like it, if possible, to have some $-token to refer to the x2 installation-drive or path :)
By the way, this was already discussed last July. Have a look at http://forum.zabkat.com/viewtopic.php?t=52 ... sc&start=0Mr.Pleasant wrote:Wow! Lately I've been hurting my brain how issue User Commands from x2 portable that refer to other executables also on my usb drive, with the ever changing drive letters. This works! I didn't know the path set in a batch file to start up x2 is passed to x2 itself. Great!
I would use %~d0 (instead of %~dp0) in the pathsetting though, this makes it easier to construct paths to executables in sibling folders of the x2 install folder. %~d0 refers to the drive letter from which the batch file is run.
- FrizzleFry
- Platinum Member
- Posts: 1241
- Joined: 2005 Oct 16, 19:09