- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Windows Server 2003
- >
- Re: Execute command on files in a dir using bat sc...
Windows Server 2003
1755763
Members
2824
Online
108838
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
тАО05-29-2005 06:26 PM
тАО05-29-2005 06:26 PM
Execute command on files in a dir using bat script
For the following name scheme:
access_log-w(WW)-(YYYY-MM-DD).log
Where
WW = week (2 digits)
YYYY = year (4 digits)
MM = month (2 d)
DD = day (2 d)
The script doesn't have to know what week it is, all it has to do is "dir" the directory, select the files that match this scheme and the execute a command with the file found (the log file as an argument.
Any pointers (or the whole script for that matter) would be mostly appreciated.
Thank you,
Maxim.
access_log-w(WW)-(YYYY-MM-DD).log
Where
WW = week (2 digits)
YYYY = year (4 digits)
MM = month (2 d)
DD = day (2 d)
The script doesn't have to know what week it is, all it has to do is "dir" the directory, select the files that match this scheme and the execute a command with the file found (the log file as an argument.
Any pointers (or the whole script for that matter) would be mostly appreciated.
Thank you,
Maxim.
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-31-2005 12:52 AM
тАО05-31-2005 12:52 AM
Re: Execute command on files in a dir using bat script
Maxim,
I'm not sure what you mean with "match the scheme", but might this be helpful?
for /f %%a in (
'dir /b "access_log-w(??)-(????-??-??).log"'
) do (
echo %%a
)
Just replace "echo" by your command.
Regards,
Wijnand
I'm not sure what you mean with "match the scheme", but might this be helpful?
for /f %%a in (
'dir /b "access_log-w(??)-(????-??-??).log"'
) do (
echo %%a
)
Just replace "echo" by your command.
Regards,
Wijnand
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-01-2005 01:57 PM
тАО06-01-2005 01:57 PM
Re: Execute command on files in a dir using bat script
Thank you.
I must have misused the term "scheme".
Your answer is exactly what I had in mind.
I must have misused the term "scheme".
Your answer is exactly what I had in mind.
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