Skip to content

ErrorWorld

For every 1603 in the World

ErrorWorld

Return filename and full path (CMD)

Search for filename and get full path and filename returned.

Return full path
MS DOS
1
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, 2014August 1, 2014Categories windows clientTags cmd, command line, command shell, filepath

Post navigation

Previous Previous post: Path Length (PS)
Next Next post: Stop Service, if running (PS)

Geeks

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

General

  • Hey, Scripting Guy!
  • IT-Ninja
  • Microsoft Script Center
  • MSI Errors
  • Windows Client
  • Windows Sysinternals

LinkedIn

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

Products

  • ConfigMgr
  • MDOP
  • WPKG

Tools

  • Virus Total

Tags

  • active directory
  • ad
  • azure
  • c2r
  • click to run
  • cmd
  • command line
  • command shell
  • config.xml
  • deploy
  • disable
  • error
  • error code
  • feature
  • filepath
  • gpo
  • group policy
  • 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
  • service
  • unblock file
  • windows
  • windows 7
  • windows 8
  • windows 10
  • windows installer
  • windows update
  • x64
ErrorWorld Proudly powered by WordPress