Any thing wrong with this one??

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 14 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
superfly12
Posts: 133
Last visit: Sun Nov 02, 2014 4:37 pm

Any thing wrong with this one??

Post by superfly12 »

Hello, I was checking software installation through registry and i've tried this simple code. For some reason it gives " 1ö was unexpected at this time." when i run it.@echo offFor /F
User avatar
superfly12
Posts: 133
Last visit: Sun Nov 02, 2014 4:37 pm

Any thing wrong with this one??

Post by superfly12 »

Hello, I was checking software installation through registry and i've tried this simple code. For some reason it gives " 1ö was unexpected at this time." when i run it.@echo offFor /F
User avatar
Gyorgy Nemesmagasi
Posts: 50
Last visit: Wed Mar 16, 2022 12:58 pm

Any thing wrong with this one??

Post by Gyorgy Nemesmagasi »

The problem about the double quotas around the Tokens=1 . You have to use " which is the same as around in the reg key in your code.
I guess you copied this code from a site or use MS Word which automatically change the quotas.

Copy the code into Notepad and check the quotas to "Tokens=1"
User avatar
superfly12
Posts: 133
Last visit: Sun Nov 02, 2014 4:37 pm

Any thing wrong with this one??

Post by superfly12 »

Hello,I've tried to find the bios date for few servers using the same code by changing the registry path and key to search but it didn't work.Gives an error "Error: The system was unable to find the specified registry key or value". When i run the same reg query command from cmd it works fine.Please advise.Here is what i've tried.@echo offSetLocal EnableDelayedExpansionFor /F "Tokens=1" %%a In (servers.txt) Do (reg query %%aHKLMHARDWREDescriptionsystem |findstr /i SystemBiosDate >> Bios.txt if not !errorlevel! == 0 (echo %%a >> computersmissing.txt)) PauseThank you.
User avatar
Gyorgy Nemesmagasi
Posts: 50
Last visit: Wed Mar 16, 2022 12:58 pm

Any thing wrong with this one??

Post by Gyorgy Nemesmagasi »

There is a missing a "A" in the reg key's HARDWARE word. If the servers.txt contains empty line(s) or hidden space after a server name or the line separator is not a dos CrLf it also failed.
I guess the SystemBiosDate >> Bios.txt in a new line is a html editing problem in the post message.
This topic is 14 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked