Cleanup Office after setup

Hi everyone, I managed to install Office silently in ntlite but I still have the Office extraction folder on my disk, is there a command that deletes it after the silent installation of Office?
 
Change your install command to:
Code:
setup.exe /configure C:\path\folder\configuration.XML && rmdir C:\path\folder /s /q
 
I added the string to the code that I had already tested and which worked: rmdir C:\office /s /q which should delete the c:\office folder after office has been installed but blocks the installation of the operating system. I also tried putting it in post setup cmd and then the string but it always blocks the installation of the operating system.
 
OK. I understand the problem now. Remember how Office setup.exe is really stupid, and you have run it INSIDE the offline folder?
You can't delete a folder while you're still inside the same folder.

Code:
cmd /c "pushd C:\Office && .\setup /configure configuration.xml && popd && rmdir C:\Office /s /q
 
But should I put this code as cmd.exe code in post setup or in winrar when I create the silent office installation package? I suppose I have to create a cmd.exe command line in post setup with the string you suggested, right?
 
WinRAR is fine. If you didn't use a SFX run the installer, it would also work as a Post-Setup command.
 
I copied the office folder into the C:\Users\User\AppData\Local\Temp\NLTmpMnt (1) folder and then in the post setup command I put your code, finish everything and tell you if it works. (see attachments)
In the meantime, thank you very much!
 

Attachments

  • 2024-02-28 19_56_01-NTLite.png
    2024-02-28 19_56_01-NTLite.png
    24.3 KB
  • 2024-02-28 19_57_59-Office.png
    2024-02-28 19_57_59-Office.png
    12.2 KB
Last edited:
cmd /c "...."

You're missing the last " in the Post-Setup command line. If you type that line in CMD, it doesn't care about the missing character.
But NTLite is feeding the line into a reg key, which Windows runs.
 
I thought your XML file was named Configurazione.xml? Are you using the right filename?
I'm providing examples written in English, because I don't know any Italian words.
 
In fact the name of my xml file is configurazione and not configuration, I then corrected the string and now everything is ok, Office is installed correctly in silent mode and in the end the folder with the installation files is deleted, you were really precious Garlin , really thank you!!!!!
 
This is my method for installing Office, which avoids any cleanup work.

1. Copy this script as RunOfficeSetup.bat and run from Post-Setup.
Code:
@echo off
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
    if exist "%%i:\Office365_Deploy" (
        set DRIVE=%%i
        goto :INSTALL
    )
)

:INSTALL
cd /d %DRIVE%:\Office365_Deploy && .\setup.exe /configure configuration-Office365-x64.xml

2. On your finished USB drive, copy the Office install folder to \Office365_Deploy. Now the Post-Setup script searches all drives, until it finds the Office folder and begins installation. No more cleanup, because the folder stays on the USB drive and is never copied to your system.

Rename the folder or configuration XML to any name you want.
 
Excellent, I will definitely try it. You were very helpful Garlin!!!
The problem that Windows did not install did not depend on the various scripts but on some bug or some of my settings, I started again from a clean Ntlite session and did everything again, and I solved it.
 
Back
Top