WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Functions

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

FileExtension Example Change

Keywords: FileExtension extension 

The example in FileExtension is correct but has a catch. The extension you are looking for must be in uppercase.
	i.e.
	If (ext == "COM") || (ext == "EXE") 
Complete Example:

	; prevent the user from editing a COM or EXE file
	allfiles = FileItemize("*.*")
	editfile = AskItemList("Select file to edit", allfiles, " ",@unsorted,  @single)
	ext = StrUpper(FileExtension(editfile))
	If (ext == "COM") || (ext == "EXE") 
        	Message ("Sorry", "You may not edit a program file")
	else
        	Run("notepad.exe", editfile)
	endif


Article ID:   W13068
Filename:   FileExtension Example.txt
File Created: 2001:01:15:10:30:02
Last Updated: 2001:01:15:10:30:02