VB - Delete files after services end

Discussion in 'Mixed Languages' started by QuantumBug, Jun 11, 2012.

  1. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,485
    1,322
    60
    Would anoyone have any clue how to delete files just before windows shutdown, or at boottime?

    It seems Windows likes to use files that have been moved and renamed(wtf), even after a reboot the file is still apparently open in winlogon.
     
  2. nodnar

    nodnar MDL Addicted

    Oct 15, 2011
    971
    661
    30
    hmm..
    never noticed it dave,
    running ccleaner before shutdown, and winpatrol in startup.
    if you still have an issue after that, regedit would seem to only
    option to prevent files from loading..


     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,485
    1,322
    60
    Hi nod, I'm actually trying to do it programatically, windows seems to be locking down uxtheme.dll as when renamed and the machine is restarted the file is STILL being read by winlogon.exe. I have tried unregistering the .dll but it won't work.
     
  4. nodnar

    nodnar MDL Addicted

    Oct 15, 2011
    971
    661
    30
    well, that`s a bit beyond me dave..
    doing things programatically..never found my feet
    there, not for want of trying..
    but being a wicked lazy old man, i would be tempted
    to put a line into the good old autoexec.bat file..
    like

    @echo y|del [directorypath] uxtheme.dll

    should load before windows and kill the darned thing..
    unless it is read-only.
    [back it up elsewhere at shutdown first..]

     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Daz

    Daz MDL Developer / Admin
    Staff Member

    Jul 31, 2009
    9,488
    66,572
    300
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. QuantumBug

    QuantumBug MDL Developer

    Mar 7, 2012
    1,485
    1,322
    60
    #6 QuantumBug, Jun 11, 2012
    Last edited: Jun 12, 2012
    (OP)
    @Daz Just what I need, thank you.

    @nodnar I was also looking into that, so it can be my failsafe.

    Problem solved.

    EDIT: Worked perfectly, my new app is now patching, replacing, renaming and deleting necessary files on reboot.