Windows

Windows shutdown command

August 21st, 2005

Problem ========= I was using Windows Remote Desktop over SSH and my mouse stopped working. The mouse clicks weren't detected remotely. Logging out of the Remote Desktop session and back in again didn't fix the problem. The only thing that seemed like it would help was a restart. However, how do you restart the remote PC without mouse clicks? It's difficult, because the normal Shut Down option in the Start menu is transformed into a Disconnect option in a Remote Desktop session, which just cuts your remote connect. You can't right-click the Windows toolbar to get the Task Manager window, and you can't Ctrl-Alt-Delete because this is picked up by your local PC rather than the remote PC. Solution ========== Use Windows XP's shutdown command. This is very similar to the UNIX shutdown command. Note: Windows 2000 doesn't have a shutdown command. Go to Start > Run. In the Run dialog box, enter: shutdown -r to restart Windows (or -s to stop Windows). You get a 30-second countdown, during which time, if you change your mind, you can abort the shutdown by going back to the Run dialog box and entering: shutdown -a If you want a quicker restart you can add a time flag to the end of the command, e.g. for 1 second rather than 30: shutdown -r -t 1 To find out more, open a command console window and type: shutdown /? Note: This command doesn't reboot the PC, it just restarts Windows, but this is often enough to solve your problem – for example, in my case it got me my mouse clicks back again.

Leave a comment

 

Using a batch file to test context-sensitive help

May 18th, 2005

Following on from my previous posting, I've found a smarter way to test context-sensitive help topics, using a Windows batch file. This way involves only one batch file, rather than two (as described previously).

Put the following batch file in your help directory. In my case this directory contains various subdirectories, one for each help project. The one I'm currently working on is called imuser, so this is the default project directory in the batch file, and the help file within this subdirectory is imuser.chm, so again this is the default. Change the two lines near the top of the batch file to change these defaults.

Once in place, all you do is double click the batch file in Windows Explorer, or double-click a shortcut to this batch file on your desktop, or in your Favorites, and a console window opens prompting you for the path, file name and map ID you want to use. You can hit Enter twice if you want to accept the defaults, but you must enter a map ID.

The help file is opened using keyHH.exe, which is a free download from Keyworks Software.

The batch file:

Read the rest of this entry »

Leave a comment



Leaving the console window open

May 17th, 2005

Occasionally, you might want to run a batch file and leave the command console window open, so that you can enter other commands in the directory where it left off. You can do this as follows. Note: In this example, I'm using a batch file to open a context-sensitive help topic, using the keyHH.exe program. 1. Create your batch file as normal. e.g. @echo off REM Change to the imuser directory REM within the current directory (i.e. the directory REM in which this batch file lives) cd %cd%\imuser REM Use keyHH.exe to open a help topic REM using its map ID @echo on keyHH.exe -myHelp -#mapid 1001 "imuser.chm>$global_ContextWindow" Notes: - I'd forgotten all about using REM for comments and switching echo on and off. It takes me way back to the 1980s when I started programming by writing programs in Mallard BASIC. - cd %cd%\imuser changes the current directory to the imuser subdirectory within the directory in which you place the batch file. 2. Save the batch file, giving it an appropriate name (with a .bat file name extension) and putting it in an appropriate directory. In this example, I'm calling the file open-context-topic.bat. For convenience, I want to have a file in the D:\CVS_local_copy\helpFiles\src directory that I can double-click to open a help topic in the child directory imuser. 3. Create another batch file. You'll use this one to open a non-closing console window from which you'll call the first batch file. e.g. @echo off REM Open a console window (using -k so that it gets left open) REM and call the batch file for opening a context-sensitive REM help topic. @echo on cmd /k "open-context-topic.bat" 4. Save this batch file in the same directory as the first one (or somewhere else if you want, but you'll need to add a path to the file name, which makes it less transportable). You can now open Windows Explorer, browse to the directory where you saved the batch files, double-click the second batch file and the command in the first file will execute and leave the console window open so that you can use it. In my case I use this to test help topics, so I copy and paste the previous command, changing the map ID number to the one for the topic I want to test. I can then leave the window open and just use the up cursor key to get the previous command each time, edit to change the map ID as required, and press Enter. It's a big time saver. To make the batch file more accessible, you can drag a shortcut to the second batch file onto the Windows Explorer Links toolbar, the desktop, your Favorites, etc.

Leave a comment



Running a batch file without displaying a console window

May 17th, 2005

Problem: I have a batch file that I want to run without it displaying the command console window. For the sake of an example, let's say this file is on my desktop and is called helpfile.bat. The file contains a single line: HH.EXE -mapid 2001 ms-its:D:\CVS_local_copy\myhelp\helpfile.chm This batch file opens up a help file, displaying a particular help topic (referenced by a map ID). I want to be able to double-click the desktop icon and get the Help viewer, without the console window. Solution: To do this I use NirCmd.exe from NirSoft (www.nirsoft.net/utils/nircmd.html). 1. Download NirCmd. It's a free download. The zip file contains the two .exe files and a very useful .chm help file. 2. Make a NirCmd directory and extract the zip contents to this directory. 3. Create a desktop shortcut with a target such as C:\path\to\nircmd\nircmd.exe exec hide "C:\path\to\youbatchfile.bat" e.g. C:\Program Files\NirCmd\NirCmd.exe exec hide "C:\Documents and Settings\Alistair\Desktop\helpfile.bat" Double-click the shortcut and the command in the batch file is executed without the console window being displayed. In my example, it's a bit dumb having both the batch file on the desktop, but you can put it wherever you like. NirCmd allows you to create shortcuts to do all sorts of things, like changing the resolution of you monitor, turning off your PC, etc. – any command you can run from Start > Run.

Leave a comment



Enabling mouse wheel scrolling

January 10th, 2005

Scrolling up and down a document using the mouse wheel can be a problem in FrameMaker. Sometimes it works, sometimes it doesn't. I have identical FrameMaker setups at work and at home, and scrolling works at home but not here at work. I finally got fed up with this and decided to sort it out. Unfortunately, updating the driver for the Intellimouse did not fix the problem. However, a good solution is to install KatMouse by Eduard Hiti: http://eduard.hiti.bei.t-online.de/ This changes the scrolling functionality, making the scroll wheel apply to whichever application happens to be under the mouse pointer - including FrameMaker windows. This sounds odd, but once you start using it it's really useful - especially in structured FrameMaker, where you can scroll the Structure View window without losing the focus in the document window. When I'm using FrameMaker I have the Structure View window permanently displayed on a second monitor, so I find this behaviour particularly useful.

Leave a comment



^ back to top ^

Page 11 of 12« FirstNewer89101112