I am making a console application where I drop files onto the .exe from Explorer and it will move them to the appropriate folder based on rules I have set in the logic of the program.
The program works great, but when I select more than 25 files and drop them on my .exe I get an error:
Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.
If I only drop 24 files from the same set it works fine.
What am I doing wrong?
Depending on your platform, you may be running into the maximum command line length. See Here for more info.
"On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters."
Is the number of files causing the maximum length of the command line (and thus arguments) to be exceeded, which causes this error?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With