Technology Questions

Go Back   Technology Questions > Software Questions > Operating System Questions > Windows XP

Windows XP Discuss the Microsoft Windows XP Operating System

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 02-07-2007, 01:02 PM
SANDY
Newsgroup Contributor
 
Posts: n/a
dos batch script to make txt file with date in name

hi
how can i create a text file using dos batch file with date and time
in name
eg testThu 02/08/2007 2300.txt

and also i want to read a text file which has list of IP address and
execute same command one by one with all the ip address in the file
the command is a snmp query

getmany -v1 < ipaddr.txt public 1.3.6.1.4.1.x.x.x.x.x.x>>test.txt

i tried few things able to put date and time in the file but not in
name
and cant read the input recursively from the ipaddress.txt file

can some one Help

Thanks in advance
sandy

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 02-07-2007, 01:02 PM
  #2 (permalink)  
Old 02-07-2007, 01:32 PM
Pegasus \(MVP\)
Newsgroup Contributor
 
Posts: n/a
Re: dos batch script to make txt file with date in name


"SANDY" <hugsandy******.com> wrote in message
news:1170881069.868888.123010@a34g2000cwb.googlegr oups.com...
> hi
> how can i create a text file using dos batch file with date and time
> in name
> eg testThu 02/08/2007 2300.txt
>
> and also i want to read a text file which has list of IP address and
> execute same command one by one with all the ip address in the file
> the command is a snmp query
>
> getmany -v1 < ipaddr.txt public 1.3.6.1.4.1.x.x.x.x.x.x>>test.txt
>
> i tried few things able to put date and time in the file but not in
> name
> and cant read the input recursively from the ipaddress.txt file
>
> can some one Help
>
> Thanks in advance
> sandy
>


Your first question:
copy /y c:\test.txt "c:\%date:/=-% %time::=-%.txt"

Your second question:
@echo off
for /F "tokens=*" %%* in ('type c:\IP.txt') do (
echo IP address=%%*
ping %%*
)


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Help with a Batch file script (FTP) Synapse Syndrome Windows Vista 0 10-26-2008 04:06 AM
Re: Help with a Batch file script (FTP) Peter Foldes Windows Vista 0 10-26-2008 04:05 AM
Can I do this with a script or batch file? Grey Windows XP 3 01-04-2007 05:05 AM
Simple Batch/Script file Question Fidelis K Windows XP 0 01-04-2007 04:56 AM
How do you pass a vb script variable to a batch file? Mike Windows XP 13 01-04-2007 03:03 AM


New To Technology Questions? Do You Need Help with Your Computer or Device? Do You Need Help with this site?

All times are GMT -8. The time now is 10:59 PM.


2003 - 2009 All Rights Reserved. Technology Questions

Search Engine Friendly URLs by vBSEO 3.3.0