Ask your question

Autorun edit on batch

Mridul - Sep 20, 2008 6:18pm BST - Last answer on Mar 9, 2009 2:09pm GMT Sen
Hello,
i want know ,how can i create a batch file which edit autorun file in every drive.thanks to all..Configuration: Windows XP Firefox 3.0
Read more ...
Add comment

« autorun edit on batch »

How to delete virus "autorun.inf" for su [Solved]ForumViruses/security
Script to edit multiple filesForumProgramming
Creating an Autorun.inf fileTipsWindows
Finding and using file date in batch command [Solved]ForumProgramming
Write in a batch file in text modeTipsMS-Dos
Renaming multiple files in batchTipsWindows XP
Sort by :   Votes | Date | Date descending 1 answers
+0
moins plus
Hi Mridul

You can use biterscripting for batch and automated editing of files.

Let's say you want to insert the first line to file A.bat on drives X:/, Y:/, and Z:/.
The line to be inserted is "THIS IS A COMMENT".

The following script in biterscripting will do the job.

var str drivelist ; set $drivelist = "X:/\tY:/\tZ:/"
while ($drivelist <> "")
do
  # Get the next drive and create the file name by appending A.bat .
  var str file, drive ; wex "1" $drivelist > $drive ; set $file = $drive+"A.bat"

  # Insert the first line into this bat file.
  var str content ; cat $file > $content
  lin "1" "THIS IS A COMMENT\n" $content > $content
  echo $content > { echo $file }
done


You can download biterscripting at http://www.biterscripting.com . It is free. I like it a lot, since you can automate a lot of such activities without having to manually open each drive, each file, type in the text, etc.

Hope this helps.
Add comment