1

I have a simple batch script take.cmd

echo %1

I've then created a shortcut to it in the C:\Users\abc\AppData\Roaming\Microsoft\Windows\SendTo folder. Specifically the shortcut and not the batch script itself so that I can run it as admin (right click > properties > advanced > Run as administrator).

Now when I right click a folder and Send To it to the shortcut I've created it prompts the consent.exe asking for permission as expected but then instead of running the batch script it flases an error saying "Filename/syntax is incorrect" (it flashes very quickly, I can hardly make it out).

Odd this is if I uncheck the "Run as administrator" from the shortcut it runs as expected (ie echos the path) without the elevation prompt.

What might be causing the error when "Run as administrator" is checked?

laggingreflex
  • 32,948
  • 35
  • 141
  • 196
  • 1
    If the flashing window you are talking about is the command window, you could try adding `pause` to your batch file to make the window stay so that you can see the actual error and, perhaps, what your command looks like when the batch script is invoked. – Andriy M Aug 13 '12 at 11:16

0 Answers0