Search found 5 matches

by AznChillin
30 May 2014 08:34
Forum: DOS Batch Forum
Topic: Silence reg query within For
Replies: 6
Views: 2761

Re: Silence reg query within For

Nevermind, it works, it didn't replace the file in my virtual machine. Thank you so much for your help.
by AznChillin
30 May 2014 08:31
Forum: DOS Batch Forum
Topic: Silence reg query within For
Replies: 6
Views: 2761

Re: Silence reg query within For

foxidrive wrote:What is the error message?

I am getting an Error: The system was unable to find the specified registry key or value
by AznChillin
30 May 2014 07:01
Forum: DOS Batch Forum
Topic: Silence reg query within For
Replies: 6
Views: 2761

Re: Silence reg query within For

foxidrive wrote:Here's something that should work:

Code: Select all

FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKLM\SOFTWARE\Windows" /v "ExePath" 2^>nul ') DO set "PATHEXE=%%B"

Wait... error is still showing on 32 bit systems...
by AznChillin
30 May 2014 06:59
Forum: DOS Batch Forum
Topic: Silence reg query within For
Replies: 6
Views: 2761

Re: Silence reg query within For

foxidrive wrote:Here's something that should work:

Code: Select all

FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKLM\SOFTWARE\Windows" /v "ExePath" 2^>nul ') DO set "PATHEXE=%%B"

Thank you so much. You are awesome.
by AznChillin
30 May 2014 06:19
Forum: DOS Batch Forum
Topic: Silence reg query within For
Replies: 6
Views: 2761

Silence reg query within For

I want to silence reg query that is within a for. if the registry doesn't exist i don't want the error to show.
Here is the line i have

Code: Select all

FOR /F "skip=2 tokens=2,*" %%A IN ('reg.exe query "HKLM\SOFTWARE\Windows" /v "ExePath"') DO set "PATHEXE=%%B"