Highlighted
Super Contributor.
Super Contributor.
2441 views

Calling an exe

Jump to solution

How do I call an exe for example notepad.exe or even exe done in NetExpress am with Visual COBOL 2.2, thank you.

0 Likes
2 Solutions

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling an exe

Jump to solution

Hello,

Each EXE is executed within its own process or run-unit, so it is not possible to call an EXE. Instead, you will need to create another run-unit from which you execute the EXE. You can find the descriptions of CBL_EXEC_RUN_UNIT from the documentations.

Here is also a demo: PARENT.zip

Regards,

–Ғɑɳօ

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Calling an exe

Jump to solution

Olá Pita,

Use a classe Process.

method-id button1_Click final private.

01 cExe type System.Diagnostics.Process.

procedure division using by value sender as object e as type System.EventArgs.

   set cExe to type System.Diagnostics.Process::Start("notepad.exe", "c:\temp\text.txt")

end method.

View solution in original post

0 Likes
6 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling an exe

Jump to solution

Hello,

Each EXE is executed within its own process or run-unit, so it is not possible to call an EXE. Instead, you will need to create another run-unit from which you execute the EXE. You can find the descriptions of CBL_EXEC_RUN_UNIT from the documentations.

Here is also a demo: PARENT.zip

Regards,

–Ғɑɳօ

View solution in original post

0 Likes
Highlighted
Super Contributor.
Super Contributor.

RE: Calling an exe

Jump to solution

I already knew this command, I found that did not work in VC, worked perfectly thank you

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Calling an exe

Jump to solution

I'm a bit confused with your reply. Are you saying that CBL_EXEC_RUN_UNIT "does not work" or "worked perfectly" in VC?

I know there was an issue for a managed code to call CBL_EXEC_RUN_UNIT that runs a native EXE, but that was fixed since version 2.0.

–Ғɑɳօ
0 Likes
Highlighted
Super Contributor.
Super Contributor.

RE: Calling an exe

Jump to solution

Sorry Google translator, worked perfectly thank you

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Calling an exe

Jump to solution

Olá Pita,

Use a classe Process.

method-id button1_Click final private.

01 cExe type System.Diagnostics.Process.

procedure division using by value sender as object e as type System.EventArgs.

   set cExe to type System.Diagnostics.Process::Start("notepad.exe", "c:\temp\text.txt")

end method.

View solution in original post

0 Likes
Highlighted
Super Contributor.
Super Contributor.

RE: Calling an exe

Jump to solution

Altair, muito boa essa saída também, obrigado.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.