Free for PREMIUM members
Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!
Learn how Concerto can help you.
' 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
Open in new window
if not exist "%File%" GOTO Syntax
rem *Breaing down the following command for documentation:
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 *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 *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 *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.
FOR /F "skip=5 tokens=5 delims= " %%A IN ('DIR/A-D/Q "%File%" ^| FIND /V "(s)"') DO @ECHO %%A
echo You must supply a valid file (including path if necessary) as the first parameter.
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.