Discussion:
Replace all backslashes in a string with double backslash
(too old to reply)
Daniel Guellmar
2005-10-26 17:40:58 UTC
Permalink
Raw Message
Hi,

I need a code to replace the backslashes in a full file location e.g.
C:\Windows\sytem32\whatever.dll so that it ends up in
C:\\Windows\\sytem32\\whatever.dll .. to import it as a key-name in the
registry.

If seen many replacing scripts ... but I think this is a special case
and I do not need a additional batch file that solves this. And I don't
want to use additional tools ... I familiar with awk, sed and that
stuff, but I dont want to use them in this case.

Any ideas?

Thanks, Daniel
foxidrive
2005-10-26 17:56:26 UTC
Permalink
Raw Message
Post by Daniel Guellmar
Hi,
I need a code to replace the backslashes in a full file location e.g.
C:\Windows\sytem32\whatever.dll so that it ends up in
C:\\Windows\\sytem32\\whatever.dll .. to import it as a key-name in the
registry.
If seen many replacing scripts ... but I think this is a special case
and I do not need a additional batch file that solves this. And I don't
want to use additional tools ... I familiar with awk, sed and that
stuff, but I dont want to use them in this case.
Any ideas?
Thanks, Daniel
set var=%variable:\=\\%

Look up
set /?
Daniel Guellmar
2005-10-26 18:16:07 UTC
Permalink
Raw Message
Post by foxidrive
Post by Daniel Guellmar
Hi,
I need a code to replace the backslashes in a full file location e.g.
C:\Windows\sytem32\whatever.dll so that it ends up in
C:\\Windows\\sytem32\\whatever.dll .. to import it as a key-name in the
registry.
If seen many replacing scripts ... but I think this is a special case
and I do not need a additional batch file that solves this. And I don't
want to use additional tools ... I familiar with awk, sed and that
stuff, but I dont want to use them in this case.
Any ideas?
Thanks, Daniel
set var=%variable:\=\\%
Look up
set /?
Wow, that was easy and exact what I was looking for.

Thanks you so much.

Daniel

Loading...