Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Yes it works, but the standard way for SET is to use the quotes like set "NewestFile=%%I"
    – jeb
    Commented Jun 29, 2011 at 20:22
  • that might be your standard, but mine is parens... :-)
    – Richard
    Commented Jul 5, 2011 at 6:54
  • But parens fails for (set var=&complex^) quotes works set "var=&complex^"
    – jeb
    Commented Jul 7, 2011 at 12:48
  • and so it is. i can't recall the last time i did bitwise math in a BAT. I was perusing the set /? and it explicitly mentions quotes for that. I've been using parens for years. Don't really feel like cleaning up the files - I think I'll live with it. After all, I have both "if %1!==!" and "if [%1]==[]" formats and I've survived.... :-)
    – Richard
    Commented Jul 20, 2011 at 21:17
  • This exact expression fails for me, with "%%I was unexpected at this time" - Windows 10, all current updates.
    – RBerman
    Commented Feb 4, 2021 at 15:20