UVK scripting commands - <Run> and <RunWait>

Show menu

<Run> and <RunWait>

These two modes are used to execute files. The difference is that <RunWait> executes an application and waits until it closes to step to next command. <Run> executes the command and continues immediately, and supports window automation. You can use the one that best fits the actions you want to perform.

Syntax:

<Run> -h -x86 -x64

;commands to run / Automation functions

 

;OR

 

<RunWait> -h -x86 -x64

;Commands to run and wait until they end

Mode parameters:

-h - Run the command in a hidden window.
-x86 - Run only if the OS is 32 bits.
-x64 - Run only if the OS is 64 bits.

Note: The intended use of -h is to prevent the cmd console from displaying when executing quick commands that automatically close when complete. Although it may be used for any other programs, it should not be used for applications that expect user input.

<Run> is a very special mode, because it allows you to automate the programs you run. Click here for more info.

Enter the commands you want to run in the lines below the Mode line. If the commands have parameters with white spaces, those parameters need to be enclosed in quotation marks.

Exemple:

 ;The commands below will not show the cmd console:

   <RunWait> -h
%comspec% /c copy /y %systemdir%\FileName.dll "%Desktop%"
%comspec% /c ren /y "%Desktop%\FileName.dll" NewName.dll

 

;Now the command below will show the normal GUI of the corresponding program:

  <Run>
%desktop%\My program.exe "My params"

 

;Now the command below will only be executed in 64 bits Windows versions.

  <Runwait> -x64
%windir%\regedit

Starting with UVK version 7.3.5, <Run> and <RunWait> commands can be used to open files and protocols.

For instance, to install an MSI package, you no longer need to use

msiexec.exe "Package path.msi" /passive /norestart

 even though it is still the recommended way. You can use just

PackagePath.msi /passive /norestart

You can also make use of this new feature to open internet locations and other protocols. For instance, you can create an app that opens one or several internet pages. Tutorials, for instance. You just need to set the URL of the page as the command.

Or you can make use of the mailto protocol to create tools that send pre-formated emails.

mailto:obama@whitehouse.gov?subject=Congrats%20Obama
mailto:obama@whitehouse.gov?subject=Congrats%20Obama&body=Enjoy%20your%20stay.%0ARegards

Or you can make your apps open local documents, such as MS office docs, text files, or PDF docs, by simply specifying the path of the document itself, which will be opened with the default application in the current PC.

%InstallSourceDir%\Docs\Tutorial 1.pdf
%ThidParty%\Docs\Tutorial 2.docx
%Desktop%\Docs\Tutorial 3.txt

Or you can run other UVK scripts easily. Now you just need to specify the path of your script in the command. Append -Auto if you want to run the script without confirmation.

%InstallSourceDir%\My script.uvk
%InstallSourceDir%\My script.uvk -Auto

 

Back to the list

 


 

Matched content by Google

Copyright Carifred © 2010 - 2022, all rights reserved.

Scroll to top