|
-
Jul 26th, 2005, 03:36 AM
#1
Thread Starter
Lively Member
Delete a File..then bring back.
hey..some1 posted some code somewhere..to delete the TASKMGR.exe file then bring it back when clicking another button.
----
heres the code:
-
MODULE:
VB Code:
Option Explicit
Private Declare Function GetSystemDirectory Lib "kernel32" Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Bffr As String
Private HasData As Boolean
Private Function SystemDir() As String
Dim a As String * 256
GetSystemDirectory a, 256
SystemDir = Left(a, InStr(a, Chr(0)) - 1)
End Function
Public Sub TaskMan(Enabled As Boolean)
If Enabled = True Then
RestoreTaskData
Else
LoadTaskData
Kill SystemDir & "\Taskmgr.exe"
End If
End Sub
Private Sub RestoreTaskData()
If HasData = False Then Exit Sub
Open SystemDir & "\Taskmgr.exe" For Output As #1
Print #1, Bffr
Close #1
Bffr = ""
HasData = False
End Sub
Private Sub LoadTaskData()
Open SystemDir & "\Taskmgr.exe" For Binary As #1
Bffr = Input(LOF(1), 1)
Close #1
HasData = True
End Sub
VB Code:
VB Code:
Option Explicit
Private Sub CmdAccept_Click()
CmdAccept.Enabled = False
CmdDisable.Enabled = True
CmdEnable.Enabled = True
End Sub
Private Sub CmdDisable_Click()
TaskMan False
MsgBox "Try Ctrl + Alt + Del, it's disabled!", vbInformation, "Taskmanager"
End Sub
Private Sub CmdEnable_Click()
TaskMan True
MsgBox "Your taskmanager is enabled!", vbInformation, "Taskmanager"
End Sub
now..how can i change that around to delete the MSMSGS.EXE file in the
Program Files\Messenger\ ..dir ?
-
Jul 26th, 2005, 03:46 AM
#2
Re: Delete a File..then bring back.
-
Jul 26th, 2005, 03:51 AM
#3
Thread Starter
Lively Member
Re: Delete a File..then bring back.
cuz..i need to somehow blok messenger quickly..and bring it back when i want to go on..without going into the direct. each time..ive figured out how to delete and bring back..but when it comes back..its a CMD type EXE??..and it opens a CMD prompt and an error when u try to open it..here is the code for bringing it back:
in the module:
VB Code:
Private Sub RestoreTaskData()
If HasData = False Then Exit Sub
Open "C:\Program Files\Messenger\msmsgs.exe" For Output As #1
Print #1, Bffr
Close #1
Bffr = ""
HasData = False
End Sub
wots wrong with this?..it works, but the EXE is not right when it comes back.
-
Jul 26th, 2005, 04:06 AM
#4
Thread Starter
Lively Member
Re: Delete a File..then bring back.
ohh. i cant bring it back this way..because it doesnt exist after i delete it..so how can i copy it from one Directory into the \Messenger\ directory? lets say from the
\Messenger\BAK\ dir. - the \Messenger\ dir.?
-
Jul 27th, 2005, 12:38 AM
#5
Thread Starter
Lively Member
Re: Delete a File..then bring back.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|