Skip to content

ErrorWorld

For every 1603 in the World

ErrorWorld

Tag: filepath

Find file and return Full Path (PS)

Looking for a file and need the location? This oneliner will return the full path of the first result found

Get-ChildItem -path c:\ -Recurse -Filter "filename" -ErrorAction SilentlyContinue | Select-Object -Property Directory -First 1 | ForEach-Object {$_.Directory.FullName}
Author ThomasPosted on March 10, 2015December 11, 2021Categories windows client, windows serverTags filepath, oneline, powershell, ps1, search

Return filename and full path (CMD)

Search for filename and get full path and filename returned.

FOR /f "tokens=1,2,*" %a in ('dir /s %fileToCheck%') do if "%a %b" == "Directory of" SET pathAndFilename=%c\%fileToCheck%

Thanks to Leif Ole for this example

Author ThomasPosted on July 4, 2014December 11, 2021Categories windows clientTags cmd, command line, command shell, filepath

Geeks

  • Johan Arwidmark
  • Kent Agerlund
  • Merill Fernando
  • Mikael Nystrom
  • Per Larsen
  • Ronni Pedersen

General

  • Hey, Scripting Guy!
  • IT-Ninja
  • MSI Errors
  • PowerShell Community
  • Windows Client
  • Windows Sysinternals

LinkedIn

  • Application Re-Packaging
  • APT&P
  • DKMCP
  • DKVUG
  • MSI Packagers
  • SCUG

Microsoft

  • Microsoft Portals

Products

  • ConfigMgr
  • MDOP
  • WPKG

Tools

  • Virus Total

Tags

  • active directory
  • azure
  • c2r
  • click to run
  • cmd
  • command line
  • command shell
  • config.xml
  • deploy
  • disable
  • error code
  • feature
  • filepath
  • gpo
  • group policy
  • local
  • mdt
  • microsoft office
  • msi
  • msiexec
  • o365
  • office
  • office 365
  • office 2010
  • office 2013
  • office 2016
  • oneline
  • packaging
  • powershell
  • property
  • ps1
  • registry
  • remote assistance
  • sccm
  • script
  • security
  • service
  • unblock file
  • windows
  • windows 7
  • windows 8
  • windows 10
  • windows installer
  • windows update
  • x64
ErrorWorld Proudly powered by WordPress