Steiner Posted May 13, 2015 Report Share Posted May 13, 2015 Hi,As the the title says, I have some issues with the copy command.Some files I want to download are provided in archives. What I want to do is, to extract them,then copy the executables inside the extracted folders to another place and delete the folder, I've tried it with this script:"..\Universal Extractor\UniExtract.exe" "..\{file}" ""copy "..\rsload.net.Asymptote.{version}\*.exe" "..\"rd "..\rsload.net.Asymptote.{version}" /s /q It extracts the archive just fine, but it only copies the file, when I run it a second time and it doesn't delete the folder at all.Any idea, what I'm doing wrong?Thanks for the help. Link to comment Share on other sites More sharing options...
necrox Posted May 13, 2015 Report Share Posted May 13, 2015 Hi, I don't think ..\ will work. As far as i remember ..\ is the main drive directory of the drive on which Ketarin was installed. Have you checked the console output? You can also try to extract your files into a temp folder and delete that folder after extraction. Example: 7z x "{file}" -o"{file:directory}\temp\" -y COPY /B "{file:directory}\temp\asy.exe" "{file:directory}\" RD /S /Q "{file:directory}\temp" Link to comment Share on other sites More sharing options...
Steiner Posted May 15, 2015 Author Report Share Posted May 15, 2015 ..\ works fine, but only when I run the script a second time, the archive has to be extracted beforehand, otherwise the copy-command does not work.Is there some sort of wait-command I could use there?Du kommst aus Deutschland, vielleicht kann ich mich auf Deutsch besser ausdrücken:Wenn ich das Skript zum ersten Mal ausführe, entpackt er den Ordner, kopiert aber nicht die angegebene Datei und löscht auch den Ordner nicht. Wenn ich das Skript dann nochmal ausführe, wird die Datei in den Hauptordner kopiert. Aber das sollte natürlich in einem Durchlauf passieren. Link to comment Share on other sites More sharing options...
necrox Posted May 16, 2015 Report Share Posted May 16, 2015 Merkwürdig. Hast Du zufällig einen XML Export für mich? Ansonsten kannst Du die Software auch in die Onlinedatenbank eintragen. Link to comment Share on other sites More sharing options...
shawn Posted May 17, 2015 Report Share Posted May 17, 2015 Wouldn't it just be easier to extract the individual file directly to where you want it to be stored? 7z e -y -o"..\" "{file}" "rsload.net.Asymptote.{version}\asymptote-{version}-setup.exe" Though, to be fair, the whole copying-the-file "up" a directory problem doesn't really exist if you extract only the one file, so you could do this instead to extract it directly to the location you really want it: 7z e -y -o"{file:directory}\" "{file}" "rsload.net.Asymptote.{version}\asymptote-{version}-setup.exe" Link to comment Share on other sites More sharing options...
Steiner Posted May 18, 2015 Author Report Share Posted May 18, 2015 Ok, I figured it out. I needed to prepend start "" /wait before calling universalextractor, so now my script looks like this: start "" /wait "..\Universal Extractor\UniExtract.exe" "..\{file}" ""copy "..\rsload.net.Asymptote.{version}\*.exe" "..\"rd "..\rsload.net.Asymptote.{version}" /s /q and everything works fine.But thanks for you help, I didn't know you can extract specific files only, this seems to be the more elegant way, I'll try that. 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