import os
f = open(r'c:\Fummy_Tasks\Fummy_Forensic\19012010\IMAGES.txt')

mkdir_name = 'mkdir c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Strings' 
print mkdir_name
os.system(mkdir_name)

mkdir_name = 'mkdir c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Memdmp' 
print mkdir_name
os.system(mkdir_name)

f = open(r'c:\\process_list_test2.img.txt','r')
process_id = f.readline()
while True:
    process_info = f.readline()
    if not process_info: break
    process_PID = process_info.split()
    openfilename = 'c:\\python26\\python.exe c:\\volatility-1.3_Beta\\volatility memdmp -f c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2.img -p %s' % (process_PID[1])
    print openfilename
    os.system(openfilename)
    string_name = 'c:\\strings\\strings.exe %s.dmp > %s.txt' %(process_PID[1],process_PID[1])
    os.system(string_name)
    move_filename = 'move %s.dmp c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Memdmp' %(process_PID[1])
    os.system(move_filename)
    move_filename = 'move %s.txt c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Strings' %(process_PID[1])
    os.system(move_filename)
f.close()

HELP! HELP HELP ...PLEASEEEEE....
The above python script is working perfectly as I have developed it. However, instead of this line to be moved to to the dir specified. I like to remove or delete because of of HDD space. Can anyone help please.....:

move_filename = 'move %s.dmp c:\\Fummy_Tasks\\Fummy_Forensic\\19012010\\test2_Memdmp' %(process_PID[1])

Thus, I have tried rmdir() or os.remove()...it doent work...

I dont want to keep line 23. I want it deleted in the dir

can anyone help please!

Well here is how you easily delete a file in python, it shouldn't be too hard to work it into your program:

>>> import os
>>> os.remove("C:\Path\to\out\file.txt")

Hope that helps :)

This article has been dead for over six months. Start a new discussion instead.