How can I get batch files to run through the new Windows Terminal? [closed]

You can have this behaviour on double click by changing HKEY_CLASSES_ROOT\batfile\shell\open\command default value from: “%1” %* to: “C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\wt.exe” -p “Command Prompt” “%1″ %* or by using ftype command: ftype batfile=”C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\wt.exe” -p “Command Prompt” “%1” %* You have to change <user> with the current user name directory and of course, this wt.exe path (C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\) is if … Read more

Test if a Font is installed

string fontName = “Consolas”; float fontSize = 12; using (Font fontTester = new Font( fontName, fontSize, FontStyle.Regular, GraphicsUnit.Pixel)) { if (fontTester.Name == fontName) { // Font exists } else { // Font doesn’t exist } }

What’s the maximum number of threads in Windows Server 2003?

First I would advise reading this: http://blogs.msdn.com/oldnewthing/archive/2007/03/01/1775759.aspx then http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx To summarise, the limitation is normally stack space (which must be in contiguous blocks) and since every thread consumes this scattered about you rapidly run out of contiguous blocks. On 64 bit machines and operating systems this is much less of a problem. Mitigation strategies exist … Read more

How do you keep the machine awake?

I use this code to keep my workstation from locking. It’s currently only set to move the mouse once every minute, you could easily adjust it though. It’s a hack, not an elegant solution. import java.awt.*; import java.util.*; public class Hal{ public static void main(String[] args) throws Exception{ Robot hal = new Robot(); Random random … Read more

How to start a system “beep”, from the built-in pc speaker, using a batch file?

WARNING: rundll32.exe Kernel32.dll,Beep 750,300 no longer works well from the command line on modern windows systems as rundll32 no longer accepts integer values (again, through the command line) and this will play the beep with the default values which is too long (and frequency is irritating): REM Again, with warnings about running this from the … Read more