Search found 12 matches

by Furplado
18 Feb 2021 14:53
Forum: DOS Batch Forum
Topic: How to bring a special string into a variable?
Replies: 4
Views: 4400

Re: How to bring a special string into a variable?

OK. I see "^" must be before a variable.
by Furplado
18 Feb 2021 14:10
Forum: DOS Batch Forum
Topic: How to bring a special string into a variable?
Replies: 4
Views: 4400

Re: How to bring a special string into a variable?

Thank you.

Very strange.
I have exactly repeated what I have done in post 1. And now the behaviour is different (without using "^" ):

Code: Select all

C:\Users\D>set "a=%BUFFER:*Word=%"

C:\Users\D>echo "%a%"
"%BUFFER:*Word=%"

C:\Users\D>
by Furplado
18 Feb 2021 11:19
Forum: DOS Batch Forum
Topic: How to bring a special string into a variable?
Replies: 4
Views: 4400

How to bring a special string into a variable?

I have all done in a cmd-window: I want to have a variable with the following content: %BUFFER:*Word=% This is what I have tried out: C:\Users\D>set "a=%BUFFER:*Word=%" This is now the content of the variable a C:\Users\D>echo "%a%" ".Document.12" C:\Users\D> My expectation was, that the content wou...
by Furplado
15 Feb 2021 08:25
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

Re: How to get all characters after a substring

What happens if you run these two commands on the CMD prompt?: for /f "usebackq skip=1 tokens=3 delims= " %x in (`reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /v progid`) do set BUFFER=%x& call vboxcontrol guestproperty set /myproperties/myproperty %...
by Furplado
14 Feb 2021 20:43
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

Re: How to get all characters after a substring

for /f "usebackq skip=1 tokens=3 delims= " %x in (`reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /v progid`) do set BUFFER=%x& call set YOURVAR=%BUFFER:*Word=% (Untested) Thank you. Your code works in a way, that now I have in the variable YOURVAR wha...
by Furplado
14 Feb 2021 16:51
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

Re: How to get all characters after a substring

Actually my second example should almost work out of the box ... Unfortunately the second example from post <14 Feb 2021 17:57> seems not to work: C:\Users\D>for /f "tokens=2*" %a in ('reg query "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice" /v "ProgID"') do @fo...
by Furplado
14 Feb 2021 13:08
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

Re: How to get all characters after a substring

Thank you. I have tried out the first example and it works. You can use the dot as delimiter instead of replacing string "Word". No, I need the version with the string "Word". I have tried to change your first example to get the version with the string "Word": for /f "tokens=2*" %a in ('reg query "H...
by Furplado
14 Feb 2021 10:33
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

Re: How to get all characters after a substring

Thank you @aGerman. Thanks to your help, the following works now: What I have typed in my cmd-window: C:\Users\D>FOR /F "tokens=* USEBACKQ" %g IN (`REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.docx\UserChoice`) do (SET "Registry1=%g") && for /f "tokens=2 d...
by Furplado
14 Feb 2021 03:09
Forum: DOS Batch Forum
Topic: How to get all characters after a substring
Replies: 11
Views: 10380

How to get all characters after a substring

In a cmd-window (Windows 7) I make this: C:\Users\D>set test=aaaIIIbbb C:\Users\D>for /f "tokens=III delims==" %%a in ("%test%") do ( echo %%a ) "%%a" cannot be processed syntactically at this point. What's wrong here? My expectation was, that I will get "bbb" as output. Would appreciate some help. ...
by Furplado
13 Feb 2021 12:31
Forum: DOS Batch Forum
Topic: How to use the output of my first command in my second command in one step?
Replies: 5
Views: 6212

How to use the output of my first command in my second command in one step?

Hello all together, (My system: Windows 7 Virtual Machine) I have two commands. The output of one command should be used for my other command. -> But it does not work. (cmd-window) What is my first command inclusive output? It is: C:\>REG QUERY HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVer...