All linked scripts can be downloaded and saved with whatever name you find convenient.
1) The IEXPRESS solution - as arguments accepts only the command and its arguments.
Example usage:
call hidder.bat myBat.bat myexe.exe call myexe.exe
2) SCHTASKS - Again accepts only two arguments - the command and the arguments.Also checks if it's started with elevated permissions and if possible gets the PID of the process with WEVTUTIL command.
Example usage:
call SCHPhidden.bat "cmd /c myBat.bat" "argument"
3) 'WScript.Shell' - the script is full wrapper of 'WScript.Shell' and every possible option can be set through the command line options.It's a jscript/batch hybrid and can be called as a bat.
Example usage (for more info print the help with '-h'):
call ShellRunJS.bat "notepad.exe" -style 0 -wait no
4) 'Win32_ProcessStartup' - again full wrapper and all options are accessible through the command line arguments.This time it's WSF/batch hybrid with some Jscript and some VBScript pieces of code - but it returns the PID of the started process.If process id not hidden some options like X/Y coordinates can be used.
Example usage (for more info print the help with '-h').This will require the full path to the executable/script if it is not in the %path%
:
call win32process.bat "notepad" -arguments "/A openFile.txt" -showWindow 0 -title "notepad"
5) The .NET solution . Most of the options of ProcessStartInfo options are used (but at the end I was too tired to include everything).Should return the PID but it does not:
Example usage (for more info print the help with '-h'):
call ProcessStartJS.bat "notepad" -arguments "/A openFile.txt" -style Hidden -directory "." -title "notepad" -priority Normal