EXECUTE FILE with/without Parameter

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

EXECUTE FILE with/without Parameter

Post by AUGE_OHR »

hi,

when have no Parameter i can use

Code: Select all

EXECUTE FILE( cCommand + CHR( 34 ) + cValue + CHR( 34 ) )
where cCommand := ""

when have Parameter that line seems not to work and i have to use

Code: Select all

   IF lWithPara = .T.
      cCommand := GETENV( "COMSPEC" ) + " /C "
   ENDIF
   IF lWithPara = .T.
      EXECUTE FILE( cCommand + CHR( 34 ) + cValue + CHR( 34 ) ) WAIT
   ELSE
      EXECUTE FILE( cCommand + CHR( 34 ) + cValue + CHR( 34 ) )
   ENDIF
Question : it it possible to use Parameter without WAIT :idea:
have fun
Jimmy
User avatar
dragancesu
Posts: 931
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: EXECUTE FILE with/without Parameter

Post by dragancesu »

When no work see manual (doc)

EXECUTE

[ OPERATION <operation> ]

[ FILE <file> ]

[ PARAMETERS <parameters> ]

[ DEFAULT <default> ]

[ MAXIMIZE | MINIMIZE | HIDE ]


EXECUTE

[ FILE <file> ]

[ MAXIMIZE | MINIMIZE | HIDE ]

WAIT


The file can be an executable file or a document file.
User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: EXECUTE FILE with/without Parameter

Post by AUGE_OHR »

hi,

thx for Answer.

i have look into Help File and Source of HMG

---

as i understand "EXECUTE FILE" will be #xcommand in c:\hmg.3.4.4\INCLUDE\i_exec.ch

_Execute() in c:\hmg.3.4.4\SOURCE\h_winapimisc.prg point to ShellExecute() which seems not to accept *.BAT, *.CMD or *.LNK

WaitRun in c:\hmg.3.4.4\SOURCE\c_winapimisc.c is a HB_FUNC( WAITRUN ) which CreateProcess() but than use WaitForSingleObject()

---

i´m searching for HB_FUNC(RUN) which just return Handle of new Process.
have fun
Jimmy
User avatar
danielmaximiliano
Posts: 2647
Joined: Fri Apr 09, 2010 4:53 pm
Location: Argentina
Contact:

Re: EXECUTE FILE with/without Parameter

Post by danielmaximiliano »

TRy TextCrawler and search in files prg and c
Return : C:\Habour\src\rtl\run.c
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*

Saludos / Regards
DaNiElMaXiMiLiAnO

Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
User avatar
AUGE_OHR
Posts: 2108
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: EXECUTE FILE with/without Parameter

Post by AUGE_OHR »

hi,
danielmaximiliano wrote: Thu Mar 12, 2020 12:55 am TRy TextCrawler and search in files prg and c
Return : C:\Habour\src\rtl\run.c
i did not know TextCrawler ... looks interesting :idea:

your Answer have give me Idea : use old RUN() command with Parameter :D
have fun
Jimmy
Post Reply