Which Script Variable to use with Windows 7 Install
#1
Posted 19 December 2012 - 08:32 AM
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
#2
Posted 19 December 2012 - 09:52 AM
DEL "%SystemDrive%\Users\Public\Desktop\*.lnk"
#3
Posted 19 December 2012 - 10:28 AM
#5
Posted 19 December 2012 - 06:22 PM
Will try that later today and post my results.
#6
Posted 20 December 2012 - 06:35 AM
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?
This post has been edited by AmazingGecko: 20 December 2012 - 06:47 AM
#7
Posted 20 December 2012 - 07:28 AM
#8
Posted 20 December 2012 - 09:13 AM
Or check the installation path for your batch file!
This post has been edited by myselfidem: 20 December 2012 - 11:07 AM
#9
Posted 21 December 2012 - 04:59 PM
@echo off
REM Deleting Desktop Shortcuts after WPI Install
DEL "%PUBLIC%\DESKTOP\*.lnk"
Strange how the same commands work in a .bat file but not from within WMI
James
#10
Posted 22 December 2012 - 01:17 AM
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
This post has been edited by myselfidem: 22 December 2012 - 02:37 AM
#11
Posted 22 December 2012 - 03:49 AM
We could use the code WPI has built in?::
{DELETE} "%PUBLIC%\DESKTOP\*.lnk" < --- Yanow in the commandline...
#12
Posted 25 December 2012 - 04:45 AM
As 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
#13
Posted 25 December 2012 - 09:58 AM
useroptions.js
// Tools tab ExecuteAfter=['"%systemdrive%\\Windows\\SETUP\\SCRIPTS\\clean.vbs"'];
This post has been edited by myselfidem: 25 December 2012 - 02:14 PM
#14
Posted 28 December 2012 - 02:38 AM
#15
Posted 28 December 2012 - 04:40 AM
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?)
This post has been edited by Kelsenellenelvian: 28 December 2012 - 04:40 AM



Help
Back to top










