Search found 12 matches
- 21 Feb 2021 02:47
- 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
Re: How to use the output of my first command in my second command in one step?
Wow, thank you @Compo. Exactly what I was asking for.
- 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.
- 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 "^" ):
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>
- 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...
- 15 Feb 2021 09:37
- 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
Re: How to use the output of my first command in my second command in one step?
Sorry for the delay and thank you both.
It's done.
It's done.
- 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 %...
- 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...
- 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...
- 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...
- 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...
- 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. ...
- 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...