intransitivelie, to windows
@intransitivelie@beige.party avatar

Ok, this is an extremely niche question, but I'm trying to work with a list of files in a Windows batch script, and one of the files contains two single quotes in the name, so the batch script is interpreting that as a command. Does anyone know of any way I can escape those single quotes programmatically? I can't simply add slashes to them because I don't have access to the filename. Should I pipe them to a text file and then munge the text file? I'm happy to give more information if necessary; this isn't a secret or anything.

P.S. If your suggestion is not to use a batch script to do this, believe me, I've considered it, but at the moment batch is what I've got. I'm not going to install an entirely new shell to do this fairly simple task and I don't like PowerShell enough to go to the trouble of scripting in that. If I were to write a non-shell program, I would probably write it in Python as that seems like the most reasonable option, but I remain convinced that there's a way to do this in a batch script.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • rosin
  • mdbf
  • khanakhh
  • tacticalgear
  • modclub
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • Youngstown
  • osvaldo12
  • slotface
  • kavyap
  • megavids
  • cubers
  • cisconetworking
  • anitta
  • tester
  • ngwrru68w68
  • everett
  • ethstaker
  • Durango
  • normalnudes
  • provamag3
  • Leos
  • GTA5RPClips
  • lostlight
  • All magazines