"Everything" file search software: open files in r

English support forum

Moderators: white, Hacker, petermad, Stefan2

raytc
Senior Member
Senior Member
Posts: 274
Joined: 2004-06-28, 11:03 UTC

Post by *raytc »

Boofo wrote:
raytc wrote:Thank you ZoSTeR,

The $parent() function was the problem.

Thanks to everyone in this thread. :)
So, what are the final settings to add to the Everything.ini then?
I added these settings in everything.ini:

explore_folder_command=$exec("c:\Program Files\totalcmd\TOTALCMD.EXE" /O /T /R="%1")
explore_folder_path_command=$exec("c:\Program Files\totalcmd\TOTALCMD.EXE" /O /T /R="%1")
open_folder_path_command=$exec("c:\Program Files\totalcmd\TOTALCMD.EXE" /O /T /L="%1")
open_file_command=$exec("%1")
open_folder_command=$exec("c:\Program Files\totalcmd\TOTALCMD.EXE" /O /T /L="%1")

p.e.
When I click on a folder in Everything it opens the folder in TC.
Right clicking on a File in Everything --> open path: it opens the file in TC

The thing I miss is to search files within in file panel in TC.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Here is what I have been using for a while now and it always seemed to work. But after looking at yours, I am not so sure now.

explore_folder_command=$exec("%SystemRoot%\explorer.exe" /n,/e,"%1")
explore_folder_path_command=$exec("%SystemRoot%\explorer.exe" /n,/e,/select,"%1")
open_folder_path_command=$exec("C:\Program Files\totalcmd\TOTALCMD.EXE" /O /T "$parent(%1)")
open_file_command=$exec("C:\Program Files\totalcmd\TOTALCMD.EXE" /O /T /L="%P" "%1")
open_folder_command=$exec("C:\Program Files\totalcmd\TOTALCMD.EXE" /O /T "%1")

I'm not sure about the right-click open path opening the file though as I have not tried it. I usually just double-click it if I need the file opened.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Hi !

I use

Code: Select all

open_folder_path_command=$exec("%COMMANDER_PATH%\TOTALCMD.EXE" /O /T "$parent(%1)")
open_folder_command=$exec("%COMMANDER_PATH%\TOTALCMD.EXE" /O /T "%1")
open_file_command=$exec("%COMMANDER_PATH%\TOTALCMD.EXE" /O /T /L="%P" "%1")
Under Vista32 without UAC (or TC started with admin privileges) this works fine (search ... enter ... see the result in tc).

But with UserAccountControl (UAC) there is a Error-Message after searching in Everything & pressing Enter: "%Commander_Path%\TOTALCMD.EXE" was not found ....

It works with UAC and absolute paths, like C:\Tools\TC\Totalcmd.exe.
Relative paths, like ".\..\TOTALCMD.EXE", don't work. Everything.exe in the root of the TC-Directory and only calling the "TOTALCMD.EXE ...." don't work.

Any ideas to use Everything in a portable version of TC under Vista with UAC ?
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

You need to use full paths with Vista. I usually do full paths anyway so I don't run into those problems. But I am on XP still so it wouldn't matter. I would change this line:
open_file_command=$exec("%COMMANDER_PATH%\TOTALCMD.EXE" /O /T /L="%P" "%1")
to
open_file_command=$exec("%COMMANDER_PATH%\TOTALCMD.EXE" /O /T /L="%1")
You don't need to %P there.

As far as portable goes, I haven't messed with that yet. I have a SanDisk 16 GB Contour U3 drive coming shortly so I will play with it more then and let you know.

I read somewhere to use %commander_drive% on a portable so I guess you would use something like:
%commander_drive%\Program Files\totalcmd\TOTALCMD.EXE
or wherever your actual path is on the portable drive.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

ZoSTeR wrote:
If I right click on a file in "everything" and click "explore path" or "open path", the file is not selected in Total Commander.
Make sure you don't use the $parent() function.
Total Commander also tries to interpret any file that is passed via command line as an archive.
So if you pass e.g. /t / o /r="C:\Test.zip" you'll actually end up inside that archive. This can lead to some unexpected behavior with some packer plugins.
There is no way to keep from ending up inside the archive. I had to adjust a plugin because of such behavior.
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Except no one can figure out why all the scripts for Everything Search Engine that a number of us wrote, and are using - wont work for you Boofo.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

2Balderstrom,

Working in the Everything.ini and working from the command line (as you stated) are 2 totally different things. Plus, I'm sure I have some plugins installed that you don't, and vice-versa. We all know that different setups can cause different problems. ;)
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Boofo wrote:I read somewhere to use %commander_drive% on a portable so I guess you would use something like:
%commander_drive%\Program Files\totalcmd\TOTALCMD.EXE
or wherever your actual path is on the portable drive.
The same like %commander_path%.

When I start TC with full admin privileges or I start Vista without UAC, Everything uses the %commander_path% or %commander_drive%. When I start Vista with UAC and the TC as a normal user, Everything can't use the Path to TC (%commander_path% is a unknown command for Everything).

Maybe there is a chance to use a batch/authohotkey to change the lines in the everything.ini to a absolute path before starting Everything?
User avatar
Boofo
Power Member
Power Member
Posts: 1431
Joined: 2003-02-11, 00:29 UTC
Location: Des Moines, IA (USA)
Contact:

Post by *Boofo »

Have you tried the line I gave you?
%commander_drive%\Program Files\totalcmd\TOTALCMD.EXE
Just use absolute paths in the Everything.ini all the time (except for the drive path, if you use it on a portable drive).
chmod a+x /bin/laden -- Allows anyone the permission to execute /bin/laden

How do I un-overwrite all my data?

User of Total Commander
#60471 Single user license
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Are non-admin users still able to launch .cmd scripts?
Can non-admin users launch cmd.exe ?
If you can launch cmd.exe, Win+R : cmd.exe
Type SET

Is Commander_Path listed?

When an admin user, is Commander_Path listed?

(Or just ignore me :-)

I'm just wondering if perhaps your PATH variable is different for Admin and non-Admin...
Then it would just be a matter of adding Commander_Path, etc to your Path for the non-Admin user.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ZoSTeR
Power Member
Power Member
Posts: 1015
Joined: 2004-07-29, 11:00 UTC

Post by *ZoSTeR »

The %commander% variables are only available to processes run from within TC.

So a CMD window started with Win+R or e.g. Everything from Autostart will never see them.
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

AH, I never even thought of that... Almost everything gets launched from a button or the TC FileList.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

Thanks for reply.

2Balderstrom: I'm a "normal" admin-user. But in Vista (with UAC) there are some restrictions for this "normal" admin. To get full admin privileges you have to demand these privileges. So I can start a cmd and a "admin"cmd... but as ZoSTeR said ... no %commander% variables.

2ZoSTeR: Yes, It's a path problem, but I start Everything from a button inside the TC. I have all my portable tools in subdirectories of TC (e.g. Totalcmd\Tools\Everything) and start these tools by TC (button-bar, menu, em_commands...).

Maybe the %commander% variables are only available for other tools (started in TC) with admin privileges / without Vista's UAC?

I thought about a batch to add the current path of Everything to the %path% and use this in the everything.ini?
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

ate wrote:I thought about a batch to add the current path of Everything to the %path% and use this in the everything.ini?
Yeah that's basically what I was thinking. Except not the "path".

I use a script MultiFileOpen.cmd to launch NotePad2.exe, when necessary - to fix some (IMHO) bad quirks with how NotePad2 works when launched from TC or when launched with an empty instance (new file).

The fix for the quirks for the most part was to SET NP2DefaultDIR=%CD%
Have notepad2.ini reference that, i.e. DefaultDir=%NP2DefaultDIR%

So if you use a .cmd script, that just manually sets a couple variables
@ECHO OFF
SET Commander_Path=C:\Path\To\Totalcmd.exe
SET Commander_INI=C:\Path\To\wincmd.ini
START "" "C:\Path\to\Everything.exe"
Under Win2K/XP the "Everything.exe" would inherit those variables into its environment, and they would be useable as normal. Vista should do this, but I don't know for sure.
User avatar
ate
Senior Member
Senior Member
Posts: 274
Joined: 2003-12-17, 22:48 UTC

Post by *ate »

2Balderstrom: Thx. I'll test it.

In the meantime I tested a other way.

Create a Button in TC with

command: %commander_path%\tools\everything\start_uac.bat %commander_path%
param: n o t h i n g
path: %commander_path%\tools\everything

(start as a symbol)

and a batch (start_uac.bat):

Code: Select all

@echo=off
cls
echo open_folder_path_command=$exec("%1\TOTALCMD.EXE" /O /T "$parent(%%1)")>> everything.ini
echo open_file_command=$exec("%1\TOTALCMD.EXE" /O /T /L="%%P" "%%1")>> everything.ini
echo open_folder_command=$exec("%1\TOTALCMD.EXE" /O /T "%%1")>> everything.ini
start everything.exe
This Batch add the lines with the current absolute path to the Everything.ini and start Everything.

It's o.k., because Everything uses the last lines (with the new absolute path) and clear unnecessary "old" lines on exit.

Nevertheless, a ugly solution.

/edit: My improved Batch

Code: Select all

@echo=off
FIND /c /I "%1" everything.ini
IF errorlevel 1 goto INI
IF errorlevel 0 goto Start

:Start
start everything.exe
goto Ende

:INI
echo open_folder_path_command=$exec("%1\TOTALCMD.EXE" /O /T "$parent(%%1)")>> everything.ini
echo open_file_command=$exec("%1\TOTALCMD.EXE" /O /T /L="%%P" "%%1")>> everything.ini
echo open_folder_command=$exec("%1\TOTALCMD.EXE" /O /T "%%1")>> everything.ini
start everything.exe

:Ende
/Edit2: 2Balderstrom: The problem with Batch & the command SET ... PATH is, that Windows only recognize this Path, if the Batch is started. After the end of the Batch, the Path will be deleted.
Post Reply