- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: I'm looking for a batch file to rename files o...
Categories
Company
Local Language
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
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
Community
Resources
Forums
Blogs
- 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
тАО07-14-2005 05:11 AM
тАО07-14-2005 05:11 AM
I have NT 4.0 SP6a server and I'm looking for a batch file
to rename files from *.cc to *.bak at the same directory.
kind regards
chris
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 04:17 PM
тАО07-14-2005 04:17 PM
SolutionFirst: Download cygwin, now you will be able to run unix commands, then its simple
for filename in "*.cc"; do
new_name=`sed -e "s/\.cc/\.bak/g"'
mv filename new_name
done
Second: If you really want to stick with .bat files, then downlaod Gnu sed. It works in Windows.
Then combine the above sed statement with windows for loop.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-14-2005 05:27 PM
тАО07-14-2005 05:27 PM
Re: I'm looking for a batch file to rename files on NT 4.0 server
I appear as dummy but I don't understand your question.
I guess the command
REN *.CC *.BAK
is too simple for your scope.
Also
FOR %I IN (*.CC) DO REN %%I *.BAK
may be too simple
Please,
may you specify some furthermore information?
Antonio Vigliotti
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 11:28 AM
тАО07-15-2005 11:28 AM
Re: I'm looking for a batch file to rename files on NT 4.0 server
it should rename files and put already renamed files
to the other server via share \\server\directory
greetings
chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-15-2005 05:33 PM
тАО07-15-2005 05:33 PM
Re: I'm looking for a batch file to rename files on NT 4.0 server
do you need diagnostic information?
Youc move file with a command file like this:
Rem Example
Rem Rename all file in current directory
REN *.CC *.BAK
Rem Now copy file onto remote server
COPY *.BAK \\SERVER\DIRECTORY
Rem Now delete from current directory
DEL *.BAK
Above command file is merely an example. It does't check error status and doesn't check id copy successfully terminated.
Antonio Vigliotti