I have a batch file question
Set "filename=C:\Documents\Example.doc"
I have a string %FILENAME% and I want to replace the C:\ with C::\, without just redefining it, can anyone help?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure what you want to achieve here, and your variant of putting all of the set command in quotes is awkward, albeit valid, but anyway:
Or you just use the
%filename:C:\=C::\%expression in places where you want the other value, without actually changing the content of theFilenamevariable.For more details see (the output of)
SET /?.