SCCM 2012 Delete a Folder

When I Install JAVA by SCCM 2012.  JAVA create a folder on the Start Menu, I want to delete this folder.
I create a bat file, who delete this folder but I have the problem that SCCM cannot detect this change and I get the error 2016410844. How can I create a Clause who detect the change? or What is the best option to avoid that JAVA create this folder?
LVL 1
Oscar PowersAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
how did you install java? using the .msi?  if so you can use orca to modify the package so it doesn't create the folder.
0
Oscar PowersAuthor Commented:
Yes I am using the msi, with this command Installation program: msiexec /i jre1.8.0_40.msi JU=0 JAVAUPDATE=0 AUTOUPDATECHECK=0 RebootYesNo=No WEB_JAVA=1 /q.
What property in orca I have to change?
0
Oscar PowersAuthor Commented:
I get this solution online. I tested on a VM and works fine, I will do in my pilot 1 computers. I copy and paste this option:
"You first need to create a vbscript file with the following content:
-------------------------------------------------------------------
dim strProgramData, strJavaPath


set wshShell = CreateObject("WScript.shell")
set scrFilesystem = CreateObject("Scripting.FileSystemObject")


strProgramData = wshShell.ExpandEnvironmentStrings("%ProgramData%")
strJavaPath = strProgramData & "\Microsoft\Windows\Start Menu\Programs\Java"


if scrFileSystem.FolderExists(strJavaPath) then
scrFileSystem.DeleteFolder(strJavaPath)
end if
---------------------------------------------------
I have named it "DelStartMenuDir.vbs" - ir can be any name, just need to know it and its location.

[Edit the MSI w/ InstEd It! or Orca:]


1. Go to "Binary" table, add row: give <NAME> and for Data [Binary Data]:
... Browse to the "DelStartMenuDir.vbs" File > OK
(The script will now be embedded into the MSI)
(No need to provide it w/ the installer when deployed)


2. Go to "CustomAction" Table > Add a row:
- Action > Give it a <TITLE>;
- Type > ENTER "6" without the Quotations!
(Type 6 = VBScript file stored in a Binary Table stream)
- Source > Type the <NAME> value from the Binary Table!
- Target > NULL (Leave Blank)!


3. Go to "InstallExecuteSequence" Table > Add a row:
- Action > Type the <TITLE> value from the CustomAction Table!
- Condition > ENTER "Not Installed" without the quotations!
- Sequence > ENTER "-1" without the quotations!
(msiDoActionStatusSuccess = -1)
(Successful completion)
(Used with Exit dialog boxes)
*It means it will be applied just before the MSI Exits
upon successful installation...

Save your MSI and run it."
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Oscar PowersAuthor Commented:
You can add vbs script to the msi with orca.  If you apply the script just after finished the installation, it will delete the folder
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.