Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


deleting a file

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Valvex
I post too much
Reputation: 0

Joined: 11 Jun 2007
Posts: 2447
Location: 127.0.0.1

PostPosted: Wed Jan 16, 2008 5:06 pm    Post subject: deleting a file Reply with quote

this code doesn't seem to work:
Code:
Private Sub Form_Load()

On Error GoTo error
Kill FilePath$ = ("C:\PROGRAM FILES\KILL.TXT")
Exit Sub
error:  MsgBox Err.Description, vbExclamation, "Error"
End Sub

anybody know whats wrong with it
Back to top
View user's profile Send private message
Noz3001
I'm a spammer
Reputation: 26

Joined: 29 May 2006
Posts: 6220
Location: /dev/null

PostPosted: Wed Jan 16, 2008 5:36 pm    Post subject: Reply with quote

maybe the space in program files?
Back to top
View user's profile Send private message MSN Messenger
Pepsiguy
I post too much
Reputation: 0

Joined: 16 Aug 2007
Posts: 2016

PostPosted: Wed Jan 16, 2008 6:47 pm    Post subject: Reply with quote

I Found a Code Call Kill("File path and name here")
_________________
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Wed Jan 16, 2008 11:29 pm    Post subject: Reply with quote

Firstly, I'd say it's probably because of the way your first line of code is setup:

Code:
Kill FilePath$ = ("C:\PROGRAM FILES\KILL.TXT")


Instead, do it like:

Code:
Dim FilePath As String
FilePath = "C:\PROGRAM FILES\KILL.TXT
Kill FilePath


If thats not the case, it could be due to the path having spaces, you can convert it like this though:

Code:
Private Declare Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal lBuffer As Long) As Long

Public Function GetShortPath(strFileName As String) As String
    Dim lngRes      As Long
    Dim strPath     As String
   
    strPath = String$(165, 0)
    lngRes = GetShortPathName(strFileName, strPath, 164)
    GetShortPath = Left$(strPath, lngRes)
End Function


You'd use this like:

Code:
Dim strFilePath As String
strFilePath = GetShortPath("C:\PROGRAM FILES\") & "KILL.TXT"


And then call the Kill on strFilePath.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
XxOsirisxX
Grandmaster Cheater Supreme
Reputation: 0

Joined: 30 Oct 2006
Posts: 1597

PostPosted: Wed Jan 16, 2008 11:58 pm    Post subject: Reply with quote

Only..

Kill ("C:/****")

_________________

Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Thu Jan 17, 2008 1:09 am    Post subject: Reply with quote

x0r wrote:
Here's a long shot; DeleteFile

It's not like the name or anything in it's description actually indicates that it will delete a file but we can hope!


Holy shit. What a crazed turn of events!
Back to top
View user's profile Send private message
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 17, 2008 8:02 am    Post subject: Reply with quote

wtf.. Can it delete system files?
_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
Elec0
Expert Cheater
Reputation: 0

Joined: 21 Nov 2007
Posts: 188
Location: Out of my mind, back in five minutes.

PostPosted: Thu Jan 17, 2008 8:45 am    Post subject: Reply with quote

Like Osiris said, you would only use this:
Code:

Call Kill("C:\Windows\*.*")


Naablet, I think that you can delete system files, but they can't be in use.

_________________
Back to top
View user's profile Send private message MSN Messenger
NINTENDO
Grandmaster Cheater Supreme
Reputation: 0

Joined: 02 Nov 2007
Posts: 1371

PostPosted: Thu Jan 17, 2008 9:19 am    Post subject: Reply with quote

Elec0 wrote:
Like Osiris said, you would only use this:
Code:

Call Kill("C:\Windows\*.*")


Naablet, I think that you can delete system files, but they can't be in use.

Ok let's do it.

dim ex(2) as string
ex(0)=".exe"
ex(1)=".dll"
Call Kill("C:\Windows\*" & ex() )

_________________
Intel over amd yes.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
stealthy17
Expert Cheater
Reputation: 0

Joined: 10 Apr 2007
Posts: 144
Location: The Netherlands

PostPosted: Thu Jan 17, 2008 9:21 am    Post subject: Reply with quote

I think it's been solved before in this thread namely

You can just use it like

Code:
Private Sub CommandWhatever_Click()
Kill("C:\whatever path\lols.exe")
End Sub


As long as the file is not in use it works perfectly fine like this...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites