stbrenner / silentcmd Goto Github PK
View Code? Open in Web Editor NEWSilentCMD executes a batch file without opening the command prompt window.
License: MIT License
SilentCMD executes a batch file without opening the command prompt window.
License: MIT License
Would it be worth mentioning in the README that prepending SilentCMD with start ""
can prevent the command prompt from appearing at all (source)? I found it useful for startup scripts.
Example: C:\Users\<USER>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\sshd-interactive-mode.bat
:
start "" C:\Users\<USER>\bin\SilentCMD\SilentCMD.exe ^
"C:\Program Files\OpenSSH\sshd.exe" ^
-f C:\Users\<USER>\.ssh\sshd_config
start ""
here prevents the cmd prompt from appearing on start. Without it the cmd prompt window lingers on the desktop even though the program exited.
But maybe it's obvious for more experienced windows users/admins.
Great utility by the way - thank you!
When no log path is provided, SilentCMD should create a default log file under %temp%\SilentCMD.log
I tried put one of these in config file - and nothing is run - only dialog appears:
"C:\tmp\SilentCMD\test.bat"
C:\tmp\SilentCMD\test.bat
test.bat
Support /? command line parameter to show a help dialog.
Example: /LOG:"%temp%\test.log"
Is there a way to print the log timestamps in international format?
YYYY-MM-DD HH:MM:SS.ms (24 hr)
So that the timestamp is consistent regardless of user's OS region settings!
This also includes having leading zeros. so a time of 8:35:3.344
would be shown as 08:35:03.334
. Again, this is for consistency in the timestamp format.
I would also like to see you skip a line (insert blank line) between each command that is run within the CMD/BAT
script
And skip 2 lines at the end. So that if append mode is used, it is easier to see when the run occurs when scanning the log visually.
option to show duration time of CMD run in seconds. You can print this on a separate line right after : Finished "path\to\script.CMD"
Duration: 52.2531243 seconds.
or HH:mm:ss,ms format might be good. Or both
Duration: 00:00:52.2531243 or 52.2531243 seconds.
Great program btw. Thank you.
Is there a way that this utility can support any installed .NET Framework? It prompts to install .NET 3.5 if it isn't installed.
If you launch PowerShell from Task Scheduler (+ parameters) a console will flash for a moment even using "-WindowStyle hidden".
Do you know an equivalent of SilenCMD to hide PowerShell console completely?
When we only put filename, and run silentCMD under elevated mode (run as administrator), it cannot find the file.
<setting name="DefaultBatchFilePath" serializeAs="String">
<value>test.bat</value>
</setting>
I have to change the Environment.CurrentDirectory
+ filename
become Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)
+ filename.
Then it only able to find the file for both normal mode & elevated mode.
===
This is a great program. Thanks.
should SilentCMD.exe still be running in Task Manager after its done the thing I told it to do in Task Scheduler?
I would be great if we can pass custom process title, to able to detect which proccess is running
the batch "title XXX" does not affecting the taskmanager due is running through silentCMD
In the config xml
How would you specify username and password ?
<setting name="DefaultBatchFileArguments" serializeAs="String">
<value>username="admin"</value>
<value>password="password"</value>
</setting>
SilentCMD [BatchFile [BatchArguments]] [Options]
Options:
/LOG:file :: output status to LOG file (overwrite existing log).
/LOG+:file :: output status to LOG file (append to existing log).
/DELAY:seconds ( delay the execution of BAT/CMD file by xxxx seconds )
Examples
SilentCMD c:\DoSomething.bat
SilentCMD c:\MyBatch.cmd MyParam1 /LOG:c:\MyLog.txt
SilentCMD c:\MyBatch.cmd /LOG+:c:\MyLog.txt
SilentCMD c:\MyBatch.cmd /DELAY:3600 /LOG+:c:\MyLog.txt
--- Very useful at boot for NET commands
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.