Doc Symbiosis Posted August 21, 2005 Share Posted August 21, 2005 I'm wondering, if in a batch file it's possible to direct the stdout into a variable ? To be more sepcific, I want to save the output of the follwoing command to a variable:reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v desktopI found a solution to this, which first saves the information to a textfile and then reads the information from there. But I've got the impression, that it's possible to do this more direct. Link to comment Share on other sites More sharing options...
Yzöwl Posted August 21, 2005 Share Posted August 21, 2005 Is this what you mean?@echo offsetlocal enableextensionsfor /f "tokens=*" %%a in ( 'reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v desktop') do ( set myvar=%%a)echo/%%myvar%%=%myvar%pauseendlocalgoto :eof Link to comment Share on other sites More sharing options...
Doc Symbiosis Posted August 21, 2005 Author Share Posted August 21, 2005 That's exactly what I looked for. Very much thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now