Wrong Passing of File Paths

Things you’d like to miss in the future...
Post Reply
Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Wrong Passing of File Paths

Post by Enternal »

I have multiple archive files throughout my hard drive. To simply testing of each archive using WinRAR, I attempted to do a search for all archives and then select them all > Use WinRAR context menu to test the archives. It failed. I then attempted another method using PaperFolders and same issue. It's a bit easier to explain using the PaperFolder method. Create 3 folders:
ARCHIVE 1, ARCHIVE 2, ARCHIVE 3. In ARCHIVE 1, create file ARCHIVE1.rar. In ARCHIVE 2, create ARCHIVE2.rar. Same thing for folder ARCHIVE 3.

Now create a PaperFolder. Drag the archive from each of the folders into the new PaperFolder. You should now have 3 items with paths something like:

Code: Select all

E:\ARCHIVE 1\ARCHIVE 1.rar
E:\ARCHIVE 2\ARCHIVE 2.rar
E:\ARCHIVE 3\ARCHIVE 3.rar
I then replaced WinRAR executable in the program directory with another program that displays the parameters that are passed to it. I then selected all items in the PaperFolder and use WinRAR context menu to test the archives. This is the result:

Code: Select all

"C:\Program Files\WinRAR\WinRAR.exe" t -iext "-an=E:\Desktop\ARCHIVE 1\ARCHIVE1.rar" "-an=E:\Desktop\ARCHIVE 1\ARCHIVE2.rar" -- "E:\Desktop\ARCHIVE 1\ARCHIVE3.rar"
As you can see, thee file paths for ARCHIVE2 and ARCHIVE3 are wrong. They both use the folder ARCHIVE 1 (which also happened because ARCHIVE1.rar from folder ARCHIVE 1 was the first file I dragged into the PaperFolder). It should actually be something like:

Code: Select all

"C:\Program Files\WinRAR\WinRAR.exe" t -iext "-an=E:\Desktop\ARCHIVE 1\ARCHIVE1.rar" "-an=E:\Desktop\ARCHIVE 2\ARCHIVE2.rar" -- "E:\Desktop\ARCHIVE 3\ARCHIVE3.rar"
The same results happened with Search results. Drag the 3 folders into a new folder named SEARCH and then do a search for all archived files. Repeat the process above.

sinilill
Posts: 111
Joined: 02 Dec 2013 18:37

Re: Wrong Passing of File Paths

Post by sinilill »

Enternal wrote:I then replaced WinRAR executable in the program directory with another program that displays the parameters that are passed to it.
What program?

highend
Posts: 13317
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Wrong Passing of File Paths

Post by highend »

What program?
No need for a program, a simple batch file can do this, e.g.:

Code: Select all

@ECHO OFF
FOR %%A IN (%*) DO (
      ECHO Arg: %%A
)
One of my scripts helped you out? Please donate via Paypal

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: Wrong Passing of File Paths

Post by Enternal »

I actually used my own program that I wrote to show me the parameters. Also tested with TheQwerty's ShowArgs which was simpler to use.
http://xyplorer.com/xyfc/viewtopic.php? ... rgs#p97753

Post Reply