Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: .vbs which can delete itself

  1. #1

    .vbs which can delete itself

    hi,

    i'm writing a visual basic script (vbs) but i need to find a way to let the script delete itself afterwards, is this possible?

    and if it is, how can i do this?
    can't find anything on google about it, although i would think this question may have rised before....

  2. #2
    Senior Member nihil's Avatar
    Join Date
    Jul 2003
    Location
    United Kingdom: Bridlington
    Posts
    17,188
    I need a bit more detail on you requirement...

    You want it to run then delete from memory, or from the actual computer?

    Are you looking at login scripts on a network?

    Sorry, I cannot see what you are trying to do.

    Cheers

  3. #3
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    have it write a batch file to delete the vbs. start the batch at the end of its run. a bat can delete itself.
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  4. #4
    I need a bit more detail on you requirement...

    You want it to run then delete from memory, or from the actual computer?

    Are you looking at login scripts on a network?

    Sorry, I cannot see what you are trying to do.

    Cheers
    i've written a small vbs to write a string to the registry, after this, it has to be removed automatically..

    i've thought about using a .bat file to remove the vbs file, and then delete itself, but i wasn't sure if it was possible...

    but how would you do that with a batchfile????

    i've written this .bat file, but this doesn't work:
    ------------------------------------------------------
    @echo off
    cd\
    cd stealth
    stealth
    cd\
    del c:\documents and settings\all users\start menu\programs\startup\test.bat
    exit
    ---------------------------------------------

    so how would you solve this with the use of a batch file???

  5. #5
    Senior Member
    Join Date
    Feb 2002
    Posts
    518
    What EXACTLY does this VBS do? Sorry to sound so suspicious, but it sounds a awful lot like you are trying to cover tracks...
    Remember -
    The ark was built by amatures...
    The Titanic was built by professionals.

  6. #6
    AntiOnline n00b
    Join Date
    Feb 2004
    Posts
    666
    i've written this .bat file, but this doesn't work:
    works for me

    i tried this
    -------------
    @echo off
    del c:\temp\myprog.frm /the form to be deleted
    del test.bat. //the batch file itself
    -----------

    both were deleted. why don't you use batch file to write to the registry instead of VBS. if you are doing thids to learn then it's okay otherwise it would be a lot easier through Batch file to weite to the reg and delete itself.

  7. #7
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    something like this would work

    this.bat
    ------------------------

    echo REGEDIT4 >my.reg

    echo [HKEY_LOCAL_MACHINE\Software\Microsoft\Whatever] >>my.reg

    echo "something"=dword:00000000 >>my.reg

    call my.reg

    del my.reg

    del this.bat

    ----------------------
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  8. #8
    What EXACTLY does this VBS do? Sorry to sound so suspicious, but it sounds a awful lot like you are trying to cover tracks...
    in this idea i've got, it is indeed used to cover tracks and to run nc.exe on a specific port with a cmd.exe, but it is not like i'm doing this to use it, it just bothered me that this option is possible within the network on my work...
    can't give you to much details, cause this info can be used pretty easy to get control over a system..
    but let's just say, i know what i'm doing, it's nothing illegal, but i haven't got enough experience with vbs to know how to do this....

    so, the main reason for doing this is to learn something from it, not to do something stupid!

  9. #9
    Senior Member
    Join Date
    Nov 2001
    Posts
    4,785
    so please explain how a reg edit will stop this. i can see a reg edit to start it with parameters on start up or to make nc a service but the only way i can see to stop nc from using a cmd shell is to disallow cmd on the computer
    Bukhari:V3B48N826 “The Prophet said, ‘Isn’t the witness of a woman equal to half of that of a man?’ The women said, ‘Yes.’ He said, ‘This is because of the deficiency of a woman’s mind.’”

  10. #10
    i was thinking about disabling registry tools and disable the use of vbs scripts....
    and of course disable the cmd.exe, but there are ways around that, so that isn't bulletproof either...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •