asked on
ASKER
ASKER
' Obtain the path to the Windows Directory and use the notepad.exe file
' as it should be on the system.
'DISABLED nLength = GetWindowsDirectory(szfilename, Len(szfilename))
'DISABLED If nLength = 0 Then
'DISABLED MsgBox "Unable to Obtain the Windows Directory"
'DISABLED End If
'DISABLED szfilename = Left$(szfilename, nLength) & "\notepad.exe"
szfilename = Me!Text1
ASKER
ASKER
@echo off
set File=%1
if not exist "%File%" GOTO Syntax
rem *Breaing down the following command for documentation:
rem *
rem *FOR /F "skip=5 tokens=5 delims= " %%A IN (...) DO ...
rem * This loops through the output from the command in the parenthesis
rem * looking for the 5th column and assigns it to %A variable.
rem * Remember: in a batch file FOR command, the variable
rem * is %a, but because it is in a FOR command, it has to have
rem * an extra % symbol in front of it. At a DOS prompt, you
rem * would just use a single % symbol.
rem *
rem *DIR/A-D/Q "%File%"
rem * This uses the DIR command matching the filespec "%File%",
rem * along with the following qualifiers:
rem * The portion "/A-D" indicates to include files with the
rem * "A"ttributes specified. In this case, "-D" means to
rem * exclude directories.
rem * /Q means to show the file owner.
rem * So list files showing the owner, excluding directories,
rem * that match the filespec "%File%", which is a DOS variable.
rem *
rem *FIND /V "(s)"
rem * This searches the reuslts passed to it and excludes lines that
rem * have the text "(s)" in them, essentially the last two summary
rem * lines of byte counts in a typical DIR command output.
rem *
rem *DO @ECHO %%A
rem * The outputs the results.
rem * Remember, we're still in the FOR command, so we have to
rem * use double % symbols. At the command promtp directly, you
rem * would not use two % symbols.
rem *
FOR /F "skip=5 tokens=5 delims= " %%A IN ('DIR/A-D/Q "%File%" ^| FIND /V "(s)"') DO @ECHO %%A
goto End
:Syntax
echo You must supply a valid file (including path if necessary) as the first parameter.
:End
ASKER
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.
TRUSTED BY
http://support.microsoft.c