Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Help with simple batch scripting
Name: serenitynow Date: April 11, 2007 at 12:17:01 Pacific OS: windows server 2003 CPU/Ram: Opteron, 2 gig Product: Dell
Comment:
A total newbie when it comes to batch scripting. I have absolutely no clue where to start.
I have a .txt file that has a list of servers separated by a carriage return.
I want a simple batch program that will read this .txt file and look for any servers that has the word "serweb" in it.
Once it finds it I want it to write that result list to a new .txt file and call it serweb_list.txt
Name: IVO Date: April 11, 2007 at 12:26:07 Pacific
Reply:
For that job one line command just suffices. At prompt type
Type server.txt | Find /I "serweb" > serweb_list.txt
and you are done (almost this time...).
0
Response Number 2
Name: serenitynow Date: April 11, 2007 at 12:34:05 Pacific
Reply:
Thanks IVO.. Will give it a shot and let u all know.
0
Response Number 3
Name: serenitynow Date: April 11, 2007 at 15:46:19 Pacific
Reply:
OK...It created the file like I wanted it to but I need to do the following with that file...
Take each of the servers listed in serweb_list.txt and then copy a log file that gets created on each server to a central file server.
The location of the log file is C:\logger and the name of the log file is http.log and the server it needs to get copied to is \\logcollector\log_share.
thanks again for all ur help.
0
Response Number 4
Name: IVO Date: April 12, 2007 at 03:27:25 Pacific
Reply:
Hmmm... as I supposed the game wasn't over.
To go on however the shared name of C:\logger for each server is needed and better to post a line of serweb_list.txt.
Copy supports UNC naming but obviously they have to be known.
0
Response Number 5
Name: serenitynow Date: April 12, 2007 at 08:10:21 Pacific
Reply:
There is no shared name perse and I suppose the way to get the log file is to use \\paftserweb001\c$\logger\http.log
Summary: Hello. I've just registered and wondered if you fine people could help me out on a simple batch script programme. I've never done any before and I have to write one that uses the below ideas: Create ...
Summary: I need help with a batch script that will do the following: Check to see if any folders or files exist in C:\Temp and if it does delete all folder in C:\Archive. If no folders or files exist in C:\Tem...
Summary: Need help with this: I shall write a "pre-installer" which will select the package to be installed. To do so it shall fetch the username and according to the first three letters of the username selec...