Sign in to follow this  
Followers 0
trainwreck07

Help, Filewrite/Deleting files/Wild cards

4 posts in this topic

Hi im new to autoit and would like to ask for some help/tips.

i am working on a script that will delete files in a certain directorey (for non malicious perpouses)

say delete

a Temporarey file on the c:/ drive.

well i was using autoit fine to create run then delete a .bat file on a users system

untill i encountered an error the error was when i was using autoit with filewrite, what it wrote was all together and not spead out

what i was expecting and hoping for was

command1

command2

command3

but what i got was

command1 command2 command3

im wondering if theirs a way i can make it spaced out. from what ive tryed i havnt found a way to send ENTER with filewrite.

heres my code if any one is wondering

filewrite($file,"")
sleep('500')
filewrite($file,$line1)
filewrite($file,$line2)
filewrite($file,$line3)
filewrite($file,$line4)
filewrite($file,$line5)
filewrite($file,$line6)
filewrite($file,$line7)

also i was wondering if their was a way to totally go and change my script and just have it delete the files from autoit itsself.

but i would have to find a way to change this

del /f /s /q %systemdrive%\*.tmp

into

delete / folder [dynamic systemdrive/leter] \ anything.tmp

does autoit have a wild card for doing such things?

thanks for all/any help i get.

Share this post


Link to post
Share on other sites



Hi im new to autoit and would like to ask for some help/tips.

i am working on a script that will delete files in a certain directorey (for non malicious perpouses)

say delete

a Temporarey file on the c:/ drive.

well i was using autoit fine to create run then delete a .bat file on a users system

untill i encountered an error the error was when i was using autoit with filewrite, what it wrote was all together and not spead out

what i was expecting and hoping for was

command1

command2

command3

but what i got was

command1 command2 command3

im wondering if theirs a way i can make it spaced out. from what ive tryed i havnt found a way to send ENTER with filewrite.

heres my code if any one is wondering

filewrite($file,"")
sleep('500')
filewrite($file,$line1)
filewrite($file,$line2)
filewrite($file,$line3)
filewrite($file,$line4)
filewrite($file,$line5)
filewrite($file,$line6)
filewrite($file,$line7)

also i was wondering if their was a way to totally go and change my script and just have it delete the files from autoit itsself.

but i would have to find a way to change this

del /f /s /q %systemdrive%\*.tmp

into

delete / folder [dynamic systemdrive/leter] \ anything.tmp

does autoit have a wild card for doing such things?

thanks for all/any help i get.

Have a look in the help for FileWriteLine ,@SystemDir and Run

Run(@ComSpec & " /c " & "del /f /s /q " & @SYSTEMDIR & "\*.tmp", "", @SW_HIDE)


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Have a look in the help for FileWriteLine ,@SystemDir and Run

Run(@ComSpec & " /c " & "del /f /s /q " & @SYSTEMDIR & "\*.tmp", "", @SW_HIDE)

oh great thanks this is good =]

Share this post


Link to post
Share on other sites

Have a look in the help for FileWriteLine ,@SystemDir and Run

Run(@ComSpec & " /c " & "del /f /s /q " & @SYSTEMDIR & "\*.tmp", "", @SW_HIDE)

Would their be a way to display a list of files that were deleted as their being deleted in say a splash screen?

thank you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0