Jump to content
Ketarin forum

Non Versioned folder name


mikeparkie
 Share

Recommended Posts

Hi there,

 

some of the portable apps I download are set to start when Windows loads, each time a new version is released I have to updated the path to the exe in the Windows startup folder because the first directory in the archive is the appname+version number.

 

My question is how do I extract the portable app into a generic folder name which keeps the folder structure but ignores the version of the program.

 

At the moment I have the following.

 

Save to file

{root}\System\{category}\{appname} [{version}].{url:ext}

 

Execute command

7z x "{file}" -o"{root}\Portable Apps\Internet\{appname}" -y

 

Answers greatly appreciated.

Link to comment
Share on other sites

I think this is what you're after. Change this:

7z x "{file}" -o"{root}\Portable Apps\Internet\{appname}" -y

To this:

7z e "{file}" -o"{root}\Portable Apps\Internet\{appname}" -y

Note that the path for the exe name will now be something like "c:\Portable Apps\Internet\myApp\myApp.exe"

Link to comment
Share on other sites

It depends on the application. If the download includes child folders that need to be preserved then you'll need to use "x" instead, but if not you'll be fine.

 

If you need to preserve the folder structure, then the best solution is to download it to a non-versioned zip file. Instead of this:

{root}\System\{category}\{appname} [{version}].{url:ext}

Use this:

{root}\System\{category}\{appname}.{url:ext}

Then you can use "x" without problem.

 

If you prefer to have a versioned archive copy, too, you can use this instead for your script (using your original version pattern):

copy "{file}" "{appname}.{file:ext}"
7z x "{file}" -o"{root}\Portable Apps\Internet\{appname}" -y
del "{appname}.{file:ext}"

Link to comment
Share on other sites

Then you're pretty much stuck. In these instances you could run another command after the extraction to rename the file/folder, or you could replace the shortcut or create a batch file or something that just relays the command to the new exe path, and use that batch file as the target of shortcuts. The wiki has examples of creating shortcuts with nircmd.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.