In this article I will give some extra information on the usage of CMD.EXE variables in batch files. These variables are stored in the so-called Environment, hence the name Environment Variables. There are two environments on a Windows machine: The System and the User environment. When a variable is set… Read more »
This week I needed to clear the ‘logon script’ field of all AD users (who had one set). While working on the code, I noticed you couldn’t just do ‘ objUser.scriptPath=”” ‘ as this would result in an error. So this was done with PutEx. The following will search for each… Read more »
This is a little known reghack: When Windows stores files in a folder on an NTFS partition, it still creates so-called 8.3 file names for compatibility with 16-bit Windows programs. When a folder has more than 4000 file entries, it becomes noticeable that access performance decreases. When the folder has more… Read more »
You are sure that the text files in a folder contain a certain string, but the Windows Explorer search doesn’t return anything! WTF? Maybe, the files just have an extension which Windows doesn’t recognize, and are therefore skipped. This is a hack to enable Windows Explorer to search in all… Read more »
Situation: You have an application server, but its network name is like abcx0143.domain.intra, which is just too hard to remember for your users. You have created a DNS alias like shares.domain.intra, but when you try to open the shared folders through that alias, it won’t work.. 🙁 BUT! There is… Read more »
Annoying: You want a command shell, but there is no folder in view in the Windows Explorer, just the files in the folder you want the shell to start in. This is a modified version of the DosHere.reg file that allows just that by right-clicking on any file system object:… Read more »
Want to get rid of those nasty balloon tips, hovering over the task tray? Here’s the registry command: reg add “HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced” /t REG_DWORD /v EnableBalloonTips /d 0 If you’d wish to re-enable them again, this is the code reg add “HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerAdvanced” /t REG_DWORD /v EnableBalloonTips /d 1
Want to get rid of the popups that appear on your Windows Print server when print jobs are to be retried? Type the following command in any command prompt window: reg add HKLMSYSTEMCurrentControlSetControlPrintProviders /v RetryPopup /t REG_DWORD /d 0 And for those who want to enable them: reg add HKLMSYSTEMCurrentControlSetControlPrintProviders… Read more »
One of the annoying things in Windows XP/2003 and later, is that the construct if not exist c:\test\*.* echo No files! does not work as expected if c:\test is empty. This seems to be due to the fact that Windows regards the “.” and “..” file entries as valid files… Read more »
This article addresses one specific use case for recursion in batch: Recursively looping through a directory (also called a folder) and its sub directories. Normally, this is a pain, and it took me a while to come up with an algorithm that works. For recursion to work correctly, you need:… Read more »