954,582 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

command line Execution?

Hi all, I want to compile the cobol program with a click of a button in toolbar provided if its compiler location and command to compile is specified.
e.g

c:\cob>cobol hello.cob 'command line equivalent

VB equivalent:

Dim command As String
         command = "cd " & app_path 
         'app_path="c:\cob"
         'app_param="cobol"
         'file_name="hello.cob"  
         stats = Shell("cmd.exe /k " & command & app_param & file_name, vbNormalFocus)


In the Cmd prompt I get:

The Directory name is Invalid.
c:\cob>


But there exists a directory named cob and file named "hello.cob".
Help needed!

ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

I Got it solved

command = app_param & " " & file_name 'cobol num.cob
         ChDir (app_path) 'compiler path
         stats = Shell("cmd.exe /k " & command, vbNormalFocus)
ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

I Got it solved

command = app_param & " " & file_name 'cobol num.cob
         ChDir (app_path) 'compiler path
         stats = Shell("cmd.exe /k " & command, vbNormalFocus)
ravi89
Junior Poster
114 posts since Jun 2009
Reputation Points: 11
Solved Threads: 13
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: