Referencing Extra Files in Scripts
PowerShell (.ps1)
# File in script root
Copy-Item -Path "$PSScriptRoot\file_to_be_copied.txt" -Destination "C:\TargetFolder"
# File in subfolder
Copy-Item -Path "$PSScriptRoot\MyFolder\file_to_be_copied.txt" -Destination "C:\TargetFolder"
Batch / CMD (.bat / .cmd)
VBScript (.vbs)
Last updated
Was this helpful?