- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- DOS batch procedure
Operating System - Microsoft
1753310
Members
6551
Online
108792
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 03:53 AM
тАО08-31-2006 03:53 AM
DOS batch procedure
Hi guys,
I need help to script this in DOS batch syntax. First I need obtain any registry data entry into the root key HKEY_LOCAL_MACHINE where the string 2.34.1.32 is present:
C:\>scanreg -s 2.34.1.32 -d lm|find "Data"
Data : "2.13.0.20,2.12.0.20,2.34.1.32"
Data : "2.34.1.32,2.34.1.54"
Data : "2.34.1.32"
So I need catch on-the-fly this output and extract second field separated by ":" and then execute to each string line the following command:
regfind -r "2.13.0.20,2.12.0.20"
In other words, the follwing executions will be done:
regedit "2.13.0.20,2.12.0.20,2.34.1.32" -r "2.13.0.20,2.12.0.20"
regedit "2.34.1.32,2.34.1.54" -r "2.13.0.20,2.12.0.20"
regedit "2.34.1.32" -r "2.13.0.20,2.12.0.20"
Rgds.
I need help to script this in DOS batch syntax. First I need obtain any registry data entry into the root key HKEY_LOCAL_MACHINE where the string 2.34.1.32 is present:
C:\>scanreg -s 2.34.1.32 -d lm|find "Data"
Data : "2.13.0.20,2.12.0.20,2.34.1.32"
Data : "2.34.1.32,2.34.1.54"
Data : "2.34.1.32"
So I need catch on-the-fly this output and extract second field separated by ":" and then execute to each string line the following command:
regfind
In other words, the follwing executions will be done:
regedit "2.13.0.20,2.12.0.20,2.34.1.32" -r "2.13.0.20,2.12.0.20"
regedit "2.34.1.32,2.34.1.54" -r "2.13.0.20,2.12.0.20"
regedit "2.34.1.32" -r "2.13.0.20,2.12.0.20"
Rgds.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-31-2006 08:05 AM
тАО08-31-2006 08:05 AM
Re: DOS batch procedure
For this kind of jobs, as you are an HP-UX expert, probably you will find unxtools very usefull:
http://unxutils.sourceforge.net/
They work very whell.
http://unxutils.sourceforge.net/
They work very whell.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-20-2006 11:04 AM
тАО09-20-2006 11:04 AM
Re: DOS batch procedure
Hi Jose!
I think it will be a good, one-line solution:
reg_srch.bat
@FOR /F "usebackq tokens=2* delims=:" %%a IN ('scanreg -s 2.34.1.32 -d lm|find "Data"') do regedit %%a -r "2.13.0.20,2.12.0.20"
For searching any other strings, ie.:
reg_srch "2.13.0.20,2.12.0.20" 2.34.1.32
@FOR /F "usebackq tokens=2* delims=:" %%a IN ('scanreg -s %2 -d lm|find "Data"') do regedit %%a -r %1
Best regards
I think it will be a good, one-line solution:
reg_srch.bat
@FOR /F "usebackq tokens=2* delims=:" %%a IN ('scanreg -s 2.34.1.32 -d lm|find "Data"') do regedit %%a -r "2.13.0.20,2.12.0.20"
For searching any other strings, ie.:
reg_srch "2.13.0.20,2.12.0.20" 2.34.1.32
@FOR /F "usebackq tokens=2* delims=:" %%a IN ('scanreg -s %2 -d lm|find "Data"') do regedit %%a -r %1
Best regards
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP