Test for arbitrary system file (or directory or desktop shortcut) paths exist on a remote PC.
It comes handy in work or school environments to know the program (usually some executable file) is present — as it probably should (for example after network un/installations or remote deployments).
For simple maintenance it uses a CSV file to store the full file paths to check upon.
Output:
jm361h01 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h02 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | OK
jm361h03 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | OK
jm361h04 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h05 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h06 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h07 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h08 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | OK
jm361h09 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | PC off
jm361h10 | C:\Program Files (x86)\Microsoft Office\Office15\EXCEL.EXE | OK
Dependency:
PsExec or PAExec (download it and put it in the current folder).
For PsExec to work, the following is required:
- File and Printer Sharing enabled
- browser, server, lmhosts and lanmanworkstation services running
- Default Admin$ share enabled
- Remote UAC LocalAccountTokenFilterPolicy enabled
- Local administrative privileges on the remote system (tip: cmdkey.exe)
https://stackoverflow.com/questions/828432/psexec-access-denied-errors
Run i.exe >installed.txt
as Administrator
- If you omit the computer name PsExec runs the application on the local system
- For network drives login explicitly, i.e.
-u [user] -p [password]
options
- PsExec does NOT send passwords in clear text as of v2.1, see https://blogs.technet.microsoft.com/sysinternals/2014/03/07/updates-process-explorer-v16-02-process-monitor-v3-1-psexec-v2-1-sigcheck-v2-03/
- PsExec starts the PSEXESVC service on the remote system (if hungs up use
sc.exe
orpskill.exe
to kill it) - http://windowsitpro.com/systems-management/psexec
- https://forum.sysinternals.com/faq-common-pstools-issues_topic15920.html
-
sort ascending
-
directory is NON empty
-
support for multiple values (delimiters:
space
,comma
orasterisk
for all) -
command-line invocation
-
check files exist without actually listing full paths (must be in
%PATH%
)system(qw(where /r "%ProgramFiles(x86)%" /q), 'winword.exe') or say "winword.exe OK"; my @whereis = split /\r?\n/, qx(where /r "%SystemDrive%" $file 2>NUL:), say $? >> 8 == 0 ? "found" : "not found";
Released into the public domain.
Don't blame me.