Thursday, October 17, 2002

Tab completion in Windows 2000 One of my favorite features of unix is tab completion. You can type the first letter of a directory, and then hit tab and it will complete the rest for you. This is enabled by default on Windows XP, but on windows 2000 it isn't. Here's how you enable it. Run regedit.exe and browse to:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\CompletionChar
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\PathCompletionChar
Set the value to the key to 09 that's hex for tab. If you only want to enable it for your user account use these keys:
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\CompletionChar
HKEY_CURRENT_USER\Software\Microsoft\Command Processor\PathCompletionChar
I guess I don't need to upgrade to XP now! I should mention that tab completion only works within the command prompt, don't expect it to work within windows file choosers.

Wednesday, October 16, 2002

Looking for Java Blogs? There is a big list of about 40 Java Blogs. Click the java.blog logo:
java.blog

Monday, October 14, 2002

How to make ColdFusion MX go to sleep
Many people have had the need for a ColdFusion page to sleep, typically between iterations of a loop. There is a tag called CFX_Sleep in the Tag Gallery, but in ColdFusion MX you don't need a CFX tag to make the current processing thread sleep using the static sleep method on the java.lang.Thread class, part of the standard java platform. Because CFMX doesn't allow us to call a static method without an object reference, we have to first use CreateObject, or CFOBJECT to get an instance of a java.lang.Thread object. We then call the Thread.sleep(long) method, which takes in the number of miliseconds to sleep for.
<cfset thread = CreateObject("java", "java.lang.Thread")>
About to sleep for 5 seconds...<cfflush>
<cfset thread.sleep(5000)>
Done sleeping.

Sunday, October 13, 2002

Uptime for Windows 2000/NT
Almost every unix distro comes with a utility called "uptime" that tells you how long your server has been running. Unfortunitly no such tool comes with windows, but there is a pretty fool proof way to determine the date you computer was last started. Type the following in to the command prompt.
net statistics server
The net command is very useful, it allows you to connect to shares, start services, send messages between computers and more. To learn more about it type:
net help
Here are some examples using the net command.

List all accounts in a domain:
net accounts /DOMAIN
Send a message to all users in the domain (a text box pops up). Replace /DOMAIN with a username to send to just one user.
net send /DOMAIN "The server is rebooting"
Start a service
net start "Service Name"
Stop a service
net stop "Service Name"

Wednesday, October 09, 2002

Bat Files to restart services
I added some batch files to the Code Samples section of the cfdev site today. The bat files can be used to restart ColdFusion 5, MX, or IIS services on Windows NT/2000/XP. Bat files are handy because you can restart multiple services with one command. You can either double click the bat file to run it, schedule it, or throw it in c:\windows\system32 and then run it from anywhere in the command prompt or (Start->Run)

Tuesday, October 08, 2002

CFC's - private works like protected

I noticed yesterday that when you use access="private" in a CFC function, inherited CFC's also have access to this function. In object oriented languages such as Java, C++, or C# this type of access is known as "protected" access. This may be a bug in CFC's, or it may just be a bug in the documentation, which states "private: available only to the component that declares the method".