File.CommandRandom
Description
- Runs a command with a randomly selected file as a parameter.
Syntax
- File.CommandRandom(commandpath, filepath, args, hide)
Parameters
- commandpath
- (string) path to the command file or program
- filepath
- (string) file path with wildcards
- args
- (mixed) arguments to use with the command
- Optional.
- hide
- (boolean)
- 1 or "hide"
- hides any output from the command
- 0 or "" (empty)
- shows any output from the command
- Optional, default is 0.
Examples
- File.CommandRandom(?"c:\program files\bat\exec.bat", ;;+
?"c:\random\*.*", date, time, 1)- Uses a file selected randomly from "c:\random\*.*" as the 1st parameter in the call to exec.bat, with the current date as the 2nd parameter & current time as the 3rd, running the command invisibly.
- File.CommandRandom(?"c:\utils\converter.exe", ;;+
?"c:\wallpapers\*.jpg", ?"c:\store\temppaper1.bmp")- Passes a random .jpg file from "c:\wallpapers" to the converter.exe program, along with another parameter "c:\store\temppaper1.bmp", displaying any program windows on screen.
See Also
-
PowerPro Help CHM > Built-in Commands > *File > Working with a randomly selected file