MetaCase Homepage
Forum Home Forum Home > > MetaEdit+
  New Posts New Posts RSS Feed - external execute problem
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

external execute problem

 Post Reply Post Reply
Author
Message
edward22243 View Drop Down
Major Contributor
Major Contributor
Avatar

Joined: 19.Apr.2019
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote edward22243 Quote  Post ReplyReply Direct Link To This Post Topic: external execute problem
    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
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Answer Answer
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 19.Jul.2019 at 13:52
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.
Back to Top
edward22243 View Drop Down
Major Contributor
Major Contributor
Avatar

Joined: 19.Apr.2019
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote edward22243 Quote  Post ReplyReply Direct Link To This Post Posted: 19.Jul.2019 at 13:25
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. 
Back to Top
stevek View Drop Down
MetaCase
MetaCase
Avatar

Joined: 11.Mar.2008
Points: 641
Answer Answer
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevek Quote  Post ReplyReply Direct Link To This Post Posted: 19.Jul.2019 at 13:52
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.
Back to Top
edward22243 View Drop Down
Major Contributor
Major Contributor
Avatar

Joined: 19.Apr.2019
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote edward22243 Quote  Post ReplyReply Direct Link To This Post Posted: 21.Jul.2019 at 19:48
Thanks for the reply. Dropped the cmd /c because indeed it is not required.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.05
Copyright ©2001-2022 Web Wiz Ltd.

This page was generated in 0.046 seconds.