external execute problem |
Post Reply |
Author | |
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
Posted: 19.Jul.2019 at 13:16 |
I want to unzip a program and in the commandline of Windows this works:
cmd /c """D:\Program Files\7-zip\7z.exe"" x -o""D:\Infraflex CAD\jajaja"" ""D:\Infraflex CAD\wisme\small_project.zip""" but: external 'cmd /c """D:\Program Files\7-zip\7z.exe"" x -o""D:\Infraflex CAD\jajaja"" ""D:\Infraflex CAD\wisme\small_project.zip"""' executeBlocking does not work. MetaCase does not give any response. When I change it to: external 'start cmd /c " ""D:\Program Files\7-zip\7z.exe"" x -o""D:\Infraflex CAD\jajaja"" ""D:\Infraflex CAD\wisme\small_project.zip"""' executeBlocking it does give me an error, it says it cannot execute it. Could someone point me in the right direction to be able to extract zip via MERL? Greetings, Edward
|
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Answer Post Options Thanks(0) |
Great that you already spotted the problem in your command line, and got it working!
You can also drop the cmd /c (which isn't needed for actual executables like 7z.exe): external '"D:\Program Files\7-zip\7z.exe" x -o"D:\Infraflex CAD\jajaja" "D:\Infraflex CAD\wisme\small_project.zip"' executeBlocking If you use Microsoft's start command (not needed here), note that it is fussy about double quotes: if your first argument is quoted, it will interpret it as a window title instead of a command, so add an extra double-quoted window title before the real argument. |
|
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
|
Disregard the message I sent please.
I tested the commands in Powershell and there it works, the same command in cmd should be different. The "" (double quotes) should be replaced by " (one quote) and then it works in cmd , and consequently it works also within external .. executeBlocking.
|
|
stevek
MetaCase Joined: 11.Mar.2008 Points: 641 |
Answer Post Options Thanks(0) |
Great that you already spotted the problem in your command line, and got it working!
You can also drop the cmd /c (which isn't needed for actual executables like 7z.exe): external '"D:\Program Files\7-zip\7z.exe" x -o"D:\Infraflex CAD\jajaja" "D:\Infraflex CAD\wisme\small_project.zip"' executeBlocking If you use Microsoft's start command (not needed here), note that it is fussy about double quotes: if your first argument is quoted, it will interpret it as a window title instead of a command, so add an extra double-quoted window title before the real argument. |
|
edward22243
Major Contributor Joined: 19.Apr.2019 Points: 41 |
Post Options
Thanks(0)
|
Thanks for the reply. Dropped the cmd /c because indeed it is not required.
|
|
Post Reply | |
Tweet |
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |