Question

Think I have a compressed file named "Target.rar" and its location is Desktop, inside it I have put a batch script. When I open the rar file (without extracting it) I can see the files inside. If I double click my batch script, winRAR first extract all files into temp folder and will run my batch script from there, so the root directory will be Temp folder, But I need to do something on .rar file location (which is desktop here).

How to get real location of Rar File?

Was it helpful?

Solution

You can search for the rar file if you are confident that you know there won't be any other files with the same name.

dir /b /s C:\Target.rar

Obviously if you know how deep you have to look you can narrow down the search path, and save some time.

If you know it will at least be under C:\Users\%username% then you can use

dir /b /s C:\Users\%username%\Target.rar
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top