Core Function Run

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> Run( <file>, <workdir>, <flag> ) </pre> === Description === Runs an external program. === Parameters === ==== file ==== The name of the executable (EXE, BAT, COM, or ...")
 
(Example)
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
 
<pre>
 
<pre>
Run( <file>, <workdir>, <flag> )
+
Run( <file>, <arguments>, <workdir>, <flag>, <show options> )
 
</pre>
 
</pre>
  
Line 12: Line 12:
  
 
The name of the executable (EXE, BAT, COM, or PIF) to run.
 
The name of the executable (EXE, BAT, COM, or PIF) to run.
 +
 +
==== arguments ====
 +
 +
Optional; The arguments to use.
  
 
==== workdir ====
 
==== workdir ====
Line 25: Line 29:
 
@SW_MAXIMIZE = Maximized window
 
@SW_MAXIMIZE = Maximized window
 
</pre>
 
</pre>
 +
 +
Default runs the program normally.
 +
 +
==== show options ====
 +
 +
Optional; Options how to executed program will run:
 +
<pre>
 +
0 = Run within the current process so that anything printed to console by the run program appears directly on ours.
 +
1 = Run the program within its own window and dont share our console.
 +
</pre>
 +
 +
Default 0.
  
 
=== Return Value ===
 
=== Return Value ===
Line 39: Line 55:
  
 
<syntaxhighlight lang="sputnik">
 
<syntaxhighlight lang="sputnik">
Run("Notepad.exe", "", @SW_MAXIMIZE);
+
Run("Notepad.exe", "", "", @SW_MAXIMIZE);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
[[Category:Core Function]]
 
[[Category:Core Function]]

Latest revision as of 16:37, 15 August 2015

Run( <file>, <arguments>, <workdir>, <flag>, <show options> )

Contents

Description

Runs an external program.

Parameters

file

The name of the executable (EXE, BAT, COM, or PIF) to run.

arguments

Optional; The arguments to use.

workdir

Optional; The working directory.

flag

Optional; The "show" flag of the executed program:

@SW_HIDE = Hidden window
@SW_MINIMIZE = Minimized window
@SW_MAXIMIZE = Maximized window

Default runs the program normally.

show options

Optional; Options how to executed program will run:

0 = Run within the current process so that anything printed to console by the run program appears directly on ours.
1 = Run the program within its own window and dont share our console.

Default 0.

Return Value

Success: The PID of the process that was launched.

Failure: 0.

Remarks

After running the requested program the script continues. To pause execution of the script until the spawned program has finished use the RunWait function instead.

Example

Run("Notepad.exe", "", "", @SW_MAXIMIZE);
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox