mikeparkie Posted August 17, 2012 Report Share Posted August 17, 2012 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 More sharing options...
shawn Posted August 18, 2012 Report Share Posted August 18, 2012 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 More sharing options...
mikeparkie Posted August 18, 2012 Author Report Share Posted August 18, 2012 I've had that set before but if you don't preserve the folder structure doesn't it break some applications. I guess I need to have a play and see what happens. Thanks for the reply. Link to comment Share on other sites More sharing options...
shawn Posted August 19, 2012 Report Share Posted August 19, 2012 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 More sharing options...
mikeparkie Posted August 24, 2012 Author Report Share Posted August 24, 2012 thats great for most cases but what if there is a folder in the archive already with a version number in the name? Link to comment Share on other sites More sharing options...
shawn Posted August 24, 2012 Report Share Posted August 24, 2012 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 More sharing options...
mikeparkie Posted August 27, 2012 Author Report Share Posted August 27, 2012 Thanks for the advice Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now