12-20-2007
trid all the options
I am using Cygwin on WIN xp
I have tried all the above recomended option to delete the file and Folder
but those folder and file are not able to remove from cygwin using the rm command ,
But when i am trying to open the internet explorer property and remove all the offline contents then only it is removing.
Please suggest
I have seen that these are the virus file generating jsut by connecting to Internet.
I want to remove these file in every 10 sec by writing a UNIX script in cygwin.
these file are getting created in /cygdrive/c/Document and setting/user/local setting/Temporary Internet files
presently i have wriiten the script to check the desktop.ini file in this directory and the SUBfolder in this directory.
It is removing the desktop.ini but not able to remove the subfoder -- here is the script i am using ---
---------------------------SCRIPT----------------
#!/bin/sh
VIRUS_DIR="/cygdrive/c/Documents and Settings/User/Local Settings/Temporary Internet Files/Content.IE5/"
vf_1="ads[1].c"
vf_2="6[1].gif"
vf_3="desktop.ini"
while true
do
##########################################
cd "$VIRUS_DIR"
echo "Current Directory now " `pwd`
if [ -f $vf_1 ]
then
rm -fr ${vf_1}
if $? -eq 0
then
echo "Virus found $vf_1 and removed "
fi
else
echo "No virus file $vf_1 now "
fi
##########################################
if [ -f $vf_2 ]
then
echo "Virus found $vf_2 "
rm -fr $vf_2
else
echo "No virus file $vf_2 now "
fi
########################################
if [ -f $vf_3 ]
then
echo "Virus found $vf_3"
/usr/bin/rm -f desktop\.ini
if [ $? -eq 0 ]
then
echo "Virus ${vf_3} removed successfully"
fi
else
echo "No such virus file found "
fi
############################################
# echo "Now removing unnecessary directory"
for i in *
do
if [ -d $i ]
then
cd $i
rm -fr *
if [ $? -eq 0 ]
then
echo "Removed all file from $i directory "
else
cd ..
chmod 000 $i
continue
fi
cd ..
rm -fr $i && echo "Removed directory $i "
fi
done
echo "Looking back and checking desktop-ini-virus"
cd ../
if [ -f $vf_3 ]
then
echo "Virus found $vf_3 in " `pwd`
/usr/bin/rm -f desktop\.ini
if [ $? -eq 0 ]
then
echo "Virus ${vf_3} removed successfully"
fi
else
echo "No such virus file found "
fi
if [ -f ads.js ]
then
rm -fr ads.js
if [ $? -eq 0 ]
then
echo "Virus : ads.js found and removed "
fi
fi
echo "Sleeping for 10 seconds ......"
sleep 10
done
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
First time on the forum. I have converted some files using the Unix to DOS command but need to strip off the last record that is generated from this conversion that contains just a ^Z. Is there any command that would accomplish this without having to do stream editing? (4 Replies)
Discussion started by: mheinen
4 Replies
2. Shell Programming and Scripting
Hello,
Can anyone tell Command/Script to remove duplicate lines from the file? (2 Replies)
Discussion started by: Rahulpict
2 Replies
3. Shell Programming and Scripting
Hi all...
I want to delete the entire text of the file and want to make it zero byte..
would you please tell me the command for it.
Thanks and regards
Vijay sahu (4 Replies)
Discussion started by: vijays3
4 Replies
4. UNIX for Dummies Questions & Answers
I have a file from which the Header and the Trailer lines need to be removed. They are confirmed to be the first and the last lines in the file.
I have tried a few commands, but not successful yet. It needs to be implemented urgently, hence any help is greatly appreciated.
Raghu
----------... (1 Reply)
Discussion started by: ragz_82
1 Replies
5. Shell Programming and Scripting
Hello. I have the following issue: my txt file has the following format:
train/dr4/fklc0/sx175.txt 0 80282 Severe myopia contributed to Ron's inferiority complex. train/dr4/fklc0/sx355.txt 0 42906 Dolphins are intelligent marine mammals. train/dr4/fklc0/sa2.txt
With the... (1 Reply)
Discussion started by: li_bi
1 Replies
6. Shell Programming and Scripting
Hi
I have a file with fields delimited by |. I need to remove the first field from the file. I tried cut but it just extracts that field.
sample.output
abc|100|name1
cde|200|name2
efg|300|name3
Output should be
sample.output
100|name1
200|name2
300|name3
thanks
Var (6 Replies)
Discussion started by: var285
6 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have catenated multiple output files (from a monte carlo run) into one big output file. Each individual file has it's own two line header. So when I catenate, there are multiple two line headers (of the same wording) within the big file. How do I use the sed command to search for the... (1 Reply)
Discussion started by: rebazon
1 Replies
8. Shell Programming and Scripting
Hi,
I writing a shell program to remove the data from output of the find which matches a list in a file
I am using the below find command to get the list of files
x=`find . -name test*.dat`
the output of the find command is as follows
test1.dat
test2.dat
test3.dat
test4.dat... (4 Replies)
Discussion started by: pals70423
4 Replies
9. Shell Programming and Scripting
I have two questions:
the first is I have a line of code:
printf "What is the id of the patient getting GJB2 analysis : "; read id that stores a user input in a variable $id in the python directory c:/Users/cmccabe/Desktop/Python27/$id.txt
Using rm I get the error cannot remove ... (21 Replies)
Discussion started by: cmccabe
21 Replies
10. UNIX for Beginners Questions & Answers
I have a eg file op.txt
This is a cat
This is a fat cat
This is a fat black cat
I want to remove only the word cat from the first alone .can somebody help.
please do wrap your samples in CODE TAGS
As per forum rules. (7 Replies)
Discussion started by: Sharks
7 Replies
LEARN ABOUT PHP
mssql_field_seek
MSSQL_FIELD_SEEK(3) MSSQL_FIELD_SEEK(3)
mssql_field_seek - Seeks to the specified field offset
SYNOPSIS
bool mssql_field_seek (resource $result, int $field_offset)
DESCRIPTION
Seeks to the specified field offset. If the next call to mssql_fetch_field(3) won't include a field offset, this field would be returned.
PARAMETERS
o $result
- The result resource that is being evaluated. This result comes from a call to mssql_query(3).
o $field_offset
- The field offset, starts at 0.
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
Using mssql_field_seek(3) on the example for mssql_fetch_field(3)
<?php
// Connect to MSSQL and select the database
mssql_connect('MANGOSQLEXPRESS', 'sa', 'phpfi');
mssql_select_db('php');
// Send a select query to MSSQL
$query = mssql_query('SELECT * FROM [php].[dbo].[persons]');
// Construct table
echo '<h3>Table structure for 'persons'</h3>';
echo '<table border="1">';
// Table header
echo '<thead>';
echo '<tr>';
echo '<td>Field name</td>';
echo '<td>Data type</td>';
echo '<td>Max length</td>';
echo '</tr>';
echo '</thead>';
// Dump all fields
echo '<tbody>';
for ($i = 0; $i < mssql_num_fields($query); ++$i) {
// Fetch the field information, notice the
// field_offset parameter is not set. See
// the mssql_field_seek call below
$field = mssql_fetch_field($query);
// Print the row
echo '<tr>';
echo '<td>' . $field->name . '</td>';
echo '<td>' . strtoupper($field->type) . '</td>';
echo '<td>' . $field->max_length . '</td>';
echo '</tr>';
// Move the internal seek pointer to the next
// row in the result set
mssql_field_seek($query, $i + 1);
}
echo '</tbody>';
echo '</table>';
// Free the query result
mssql_free_result($query);
?>
SEE ALSO
mssql_fetch_field(3).
PHP Documentation Group MSSQL_FIELD_SEEK(3)