Check/Modify  Windows' GUI Defaults

Problem: Microsoft's default graphical user interface (GUI) settings can cause problems for Windows users. Specifically, it's not helpful to have file extensions hidden, preventing a user from easily distinguishing between MYFILE.DOC and MYFILE.MEM. This can even be confusing matter for harried IT support personnel working with Windows NT, for example, in that they cannot easily distinguish an important file such as NTUSER.DAT from its counterpart, NTUSER.DAT.LOG. To further exacerbate the problem, another default Windows setting prevents the path of a folder, file, or networked computer from being displayed in the title bar of any given dialog box. This can make it more difficult to determine the disk location of items and to successfully navigate the file system. However, recognizing that non-support personnel should not be able to easily modify or delete *.EXE, *.DLL and other critical system files, it's also important to be certain that the Show All Files option is disengaged for most users.

While the GUI settings can be easily changed on a single-user system and usually remain intact, the settings are based upon Windows' user profiles. For multiple users of a single PC (including help desk personnel logging on to another user's system locally), the GUI settings are often set contrary to what they should be. Even experienced support professionals have been known to become thoroughly frustrated during lengthy Windows troubleshooting sessions, only to finally realize the problem could have been easily solved earlier if they had only thought to check the GUI settings!

Solution: Wrestling with this problem for some time, Chris Morton finally received that flash of inspiration that resulted in the WinBatch code listed below. There are two versions of the utility, CHKGUI_P.EXE, for support professionals, and CHKGUI_U.EXE, for ordinary users. In the world of Windows NT in particular, the groups to which a given user belongs determines which version of the utility is automatically activated during a PC's login sequence. Compiling his base code shown below, Morton distributed the pair of executable files to his Learning Tree International  students on a royalty-free basis.


; Routine relies upon optional WinBatch extender, WWWCTL32I.DLL.  
; Written by Chris Morton, 1999.

;========= Initialize WinBatch Extender and View|Options|View dialog box ===========

AddExtender("wwctl32i.dll")
RunHide("Explorer","")
SendKeysTo("~Exploring","!vo")
WinHide("~Options")
multiwnd=DllHwnd("Options")

;Provide access to Explorer's View-Options-View dialog box
defwnd=cWndByName(multiwnd,"View")  

;======= CHKGUI_P.EXE ======= 
;   Only activate this section for support professionals 
;   Preface each line with a semi-colon to disable as desired
;   Explanatory comments are prefaced by (;; **) 


;; **Determine status of "Show All Files" option
showfiles=cWndByName(defwnd,"Show all files")     

radbutn=cRadioButton(showfiles,-1)

;; **Make sure "Show All Files" option is engaged
If radbutn !=1 Then cRadioButton(showfiles,1)

=============================      

;======= CHKGUI_U.EXE ======= 
;   Only activate this section for ordinary users
;   Preface each line with a semi-colon to disable as desired
;   Explanatory comments are prefaced by (;; **)


;hidefiles=cWndByName(defwnd,"Hide files of these types:")
;radbutn=cRadioButton(hidefiles,-1)

;; **Make sure "Show All Files" option is disengaged
;If radbutn !=1 Then cRadioButton(hidefiles,1)  

=============================

;====== COMMON SECTION FOLLOWS ======  


prefchk1=cWndByname(defwnd,"Display the full path in the title bar")
chk1=cCheckbox(prefchk1,-1)

;Make sure "Display full path" option is engaged
If
chk1 !=1 Then cCheckbox(prefchk1,1)            

prefchk2=cWndByname(defwnd,"Hide file extensions for known file types")
chk2=cCheckbox(prefchk2,-1)

;Make sure "Hide file extensions" option is disengaged
If
chk2 ==1 Then cCheckbox(prefchk2,0)            

;Close Options dlg box, saving GUI chgs
SendKeysTo("~Options","{ENTER}") 

WinClose("~Exploring")           ;Close Explorer