When we start dragging (either on drag start or after drop) a file from e.g. the desktop called hello.pdf
, I need to detect which file is being dragged in Powershell or Batch and copy this file to a different folder e.g. desktop/ps_copies
, or at least get the path of the file that's being dragged (in this case hello.pdf
) and save it into dragged_file_path.txt
<detect dragged file here and save into $pathOfDraggedFile>
$pathOfDraggedFile = "..."
Copy-Item $pathOfDraggedFile -Destination "C:\Users\X\Desktop\ps_copies"
OR $pathOfDraggedFile | Out-File -FilePath C:\Users\X\Desktop\dragged_file_path.txt
Is something like this even possible while Powershell itself is unfocused?