$WNDOWS.~BT and $WNDOWS.~LS getting created automaticaly in my OS

Discussion in 'Windows 7' started by LiuBang, Feb 8, 2022.

  1. LiuBang

    LiuBang MDL Member

    Oct 19, 2020
    150
    55
    10
    #1 LiuBang, Feb 8, 2022
    Last edited: Feb 8, 2022
    so it goes like this
    i installed an edited windows 7 image that was a legit microsoft image and updated
    i did afew changes then captured it
    now when i install it i find these 2 folders, these 2 folders weren't in it when i captured it
    Untitled.jpg
    ($WNDOWS.~BT and $WNDOWS.~LS)
    so they get automaticaly created
    i don't know why they are created
    so i need an option of 2
    1- prevent them from getting created
    2- initiating a command once the OS get installed to delete them
    they seem to be created from the install.wim because of something i don't know
    so i went to option 2
    i found a command that would delete them and here it's:
    takeown /F C:\$Windows.~BT\* /R /A
    icacls C:\$Windows.~BT\*.* /T /grant administrators:F
    rmdir /S /Q C:\$Windows.~BT\
    takeown /F C:\$Windows.~LS\* /R /A
    icacls C:\$Windows.~LS\*.* /T /grant administrators:F
    rmdir /S /Q C:\$Windows.~LS\

    i tried putting it in the setupcomplete.cmd like this :
    @echo off
    takeown /F C:\$Windows.~BT\* /R /A
    icacls C:\$Windows.~BT\*.* /T /grant administrators:F
    rmdir /S /Q C:\$Windows.~BT\
    takeown /F C:\$Windows.~LS\* /R /A
    icacls C:\$Windows.~LS\*.* /T /grant administrators:F
    rmdir /S /Q C:\$Windows.~LS\

    and guess what happened!
    nothing
    i tried then in a win 10 image (captured image and suffers from $WNDOWS.~LS only )
    and guess what happened!

    voila
    nothing!

    now there is 1 of cases happened
    1- the setupcomplete.cmd not intiated at all because the image captured (i don't know if this is possible)
    2- the setupcomplete.cmd intiated but the folders got created after it's intiation

    i don't know really what to do

    but the object is simple,it's either they don't get created or give me a command or anything that will auto delete them once the OS gets installed

    if you did read all that then i have to salute you and thank you because reading all that is really an effort
    if someone could help because i ran out of hair to pull out
    PS:i'm using autounattend
     
  2. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    50,602
    107,781
    450
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. LiuBang

    LiuBang MDL Member

    Oct 19, 2020
    150
    55
    10
    can't i just put a command in the setupcomplete.cmd or the autounattend.xml to delete them once the OS gets installed
    and will this command get initiated after their creation or before

    i know that i sound stupid but it's just because i'm tired of putting stuff together and redoing alot of steps because of forgetting stuff because most of the time i don't list what i want to do