AmazingGecko

Which Script Variable to use with Windows 7 Install

15 posts in this topic

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

0

Share this post


Link to post
Share on other sites

You can use:

DEL "%SystemDrive%\Users\Public\Desktop\*.lnk"

0

Share this post


Link to post
Share on other sites

You can use:

DEL "%SystemDrive%\Users\Public\Desktop\*.lnk"

Shorter!

%PUBLIC%\DESKTOP

0

Share this post


Link to post
Share on other sites

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 by AmazingGecko
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

Could you attach your config.js file please?

Or check the installation path for your batch file!

Edited by myselfidem
0

Share this post


Link to post
Share on other sites

Decided to teach myself how to write a .bat file and hey presto - it now works!

@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 :wacko:

James

0

Share this post


Link to post
Share on other sites

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 by myselfidem
0

Share this post


Link to post
Share on other sites

OR!!

We could use the code WPI has built in?::

{DELETE} "%PUBLIC%\DESKTOP\*.lnk" < --- Yanow in the commandline...

0

Share this post


Link to post
Share on other sites

Hi Kel

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

0

Share this post


Link to post
Share on other sites

Yes, I use also like this!

useroptions.js


// Tools tab
ExecuteAfter=['"%systemdrive%\\Windows\\SETUP\\SCRIPTS\\clean.vbs"'];

Edited by myselfidem
0

Share this post


Link to post
Share on other sites

OR!!

We could use the code WPI has built in?::

{DELETE} "%PUBLIC%\DESKTOP\*.lnk" < --- Yanow in the commandline...

Thanks Kels! Works fine.

WPI_Log.txt


vendredi 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

0

Share this post


Link to post
Share on other sites

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 by Kelsenellenelvian
0

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.