I have created a powershell script that will copy selected files to predetermined location.
I have created a batch file to call the Powershell script from Windows Explorer "Send to" menu.
The batch file sends the selected file name as a parameter to the script. The file names can contain spaces.
The batch file code is
powershell "C:\copycommand.ps1 '%1'"
When multiple files are selected I want to send all the file names as an array to the powershell script.
I have written the powershell script to accept arrays but I am not able to send the file names as an array from the batch file.
The below batch script sends all the filenames to the batch file but fails when the filename has spaces.
Powershell "C:\copycommand.ps1" %*
Is there a way in which I can send all the filenames to the powershell script.