AmazingGecko Posted December 19, 2012 Share Posted December 19, 2012 After reading several threads and posts I need some clarification on the following:I want to use a script that will tell WPI to execute after it installs all my apps that will remove all the desktop shortcuts. The general thought is to use -del /s/q "%allusersprofile%\Desktop\*.lnk"However, research on the web says that the variable %allusersprofile% has changed in Windows 7 to %programdata%. Can anyone confirm this and if so does the rest of the script change in any way?James Link to comment Share on other sites More sharing options...
myselfidem Posted December 19, 2012 Share Posted December 19, 2012 You can use:DEL "%SystemDrive%\Users\Public\Desktop\*.lnk" Link to comment Share on other sites More sharing options...
Yzöwl Posted December 19, 2012 Share Posted December 19, 2012 You can use:DEL "%SystemDrive%\Users\Public\Desktop\*.lnk"Shorter!%PUBLIC%\DESKTOP Link to comment Share on other sites More sharing options...
myselfidem Posted December 19, 2012 Share Posted December 19, 2012 Nice! Thanks Link to comment Share on other sites More sharing options...
AmazingGecko Posted December 20, 2012 Author Share Posted December 20, 2012 Thanks guys! Will try that later today and post my results. Link to comment Share on other sites More sharing options...
AmazingGecko Posted December 20, 2012 Author Share Posted December 20, 2012 (edited) Ok, tried the following scripts: DEL "%PUBLIC%\DESKTOP\*.lnk"DEL "%SystemDrive%\Users\Public\Desktop\*.lnk"del /s/q "%allusersprofile%\Desktop\*.lnk"and it fails every time with the returned code:(returned code 999)Any ideas? Edited December 20, 2012 by AmazingGecko Link to comment Share on other sites More sharing options...
AmazingGecko Posted December 20, 2012 Author Share Posted December 20, 2012 I've noticed others also having issues with using this script but when inserted into a bat file and run it worked fine. I have no experience with writing bat files but if someone could give me some pointers on what and where to save it I'm sure I could resolve this. Link to comment Share on other sites More sharing options...
myselfidem Posted December 20, 2012 Share Posted December 20, 2012 (edited) Could you attach your config.js file please?Or check the installation path for your batch file! Edited December 20, 2012 by myselfidem Link to comment Share on other sites More sharing options...
AmazingGecko Posted December 21, 2012 Author Share Posted December 21, 2012 Decided to teach myself how to write a .bat file and hey presto - it now works! @echo offREM Deleting Desktop Shortcuts after WPI InstallDEL "%PUBLIC%\DESKTOP\*.lnk"Strange how the same commands work in a .bat file but not from within WMI James Link to comment Share on other sites More sharing options...
myselfidem Posted December 22, 2012 Share Posted December 22, 2012 (edited) Some help about path for batch files using WPI:http://www.msfn.org/...ost__p__1007716*Edit: Tested the batch file using with WPI and works fine!Batch file set inside:.\sources\$OEM$\$$\Setup\scripts\Clean.cmd Edited December 22, 2012 by myselfidem Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted December 22, 2012 Share Posted December 22, 2012 OR!!We could use the code WPI has built in?::{DELETE} "%PUBLIC%\DESKTOP\*.lnk" < --- Yanow in the commandline... Link to comment Share on other sites More sharing options...
AmazingGecko Posted December 25, 2012 Author Share Posted December 25, 2012 Hi KelAs I stated above I did use your suggestion to no avail. I'm starting to wonder if I'm putting in the wrong place. I didn't want to have to add that command to every individual app command page so I put it in the "Execute after" entry on the Options/Tools tab.Is that the wrong place?James Link to comment Share on other sites More sharing options...
myselfidem Posted December 25, 2012 Share Posted December 25, 2012 (edited) Yes, I use also like this!useroptions.js// Tools tabExecuteAfter=['"%systemdrive%\\Windows\\SETUP\\SCRIPTS\\clean.vbs"']; Edited December 25, 2012 by myselfidem Link to comment Share on other sites More sharing options...
myselfidem Posted December 28, 2012 Share Posted December 28, 2012 OR!!We could use the code WPI has built in?::{DELETE} "%PUBLIC%\DESKTOP\*.lnk" < --- Yanow in the commandline...Thanks Kels! Works fine.WPI_Log.txtvendredi 28 décembre 2012 09:34:35 Programme: Ashampoo ID unique: ASHAMPOO Ordre: 000001 Catégorie: Applications vendredi 28 décembre 2012 09:34:58 - cmd1 Succès (Code de retour 0): "C:\WPI_v8.6.3\Install\abs6_free.exe" vendredi 28 décembre 2012 09:34:58 - Installation terminée.-----vendredi 28 décembre 2012 09:34:58 Programme: Clean ID unique: CLEAN Ordre: 000002 Catégorie: Applications vendredi 28 décembre 2012 09:34:59 - cmd1 Succès (Code de retour 0): CMD /C DEL /F /Q "C:\Users\Public\DESKTOP\*.lnk" vendredi 28 décembre 2012 09:35:01 - Installation terminée.-----Nombre d'installations échouées: 0 Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted December 28, 2012 Share Posted December 28, 2012 (edited) OK for SOME unremembered reason we didn't add the special command support in the execute after and before lines.So for cmd styles you would add the ACTUAL command:Execute after:Regedit /s %path%\reg.reg(As noted in recent post I am not actively developing WPI for a long time so who knows when that will change?) Edited December 28, 2012 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now