Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

Which Script Variable to use with Windows 7 Install

- - - - -

  • Please log in to reply
14 replies to this topic

#1
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
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


How to remove advertisement from MSFN

#2
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
You can use:

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

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#3
Yzöwl

Yzöwl

    Wise Owl

  • Super Moderator
  • 4,537 posts
  • Joined 13-October 04
  • OS:Windows 7 x64
  • Country: Country Flag

Donator

You can use:

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

Shorter!
%PUBLIC%\DESKTOP


#4
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
Nice! Thanks :)
For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#5
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
Thanks guys!

Will try that later today and post my results.

#6
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
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, 20 December 2012 - 06:47 AM.


#7
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
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.

#8
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
Could you attach your config.js file please?

Or check the installation path for your batch file!

Edited by myselfidem, 20 December 2012 - 11:07 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#9
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
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

#10
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
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, 22 December 2012 - 02:37 AM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#11
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,810 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
OR!!

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

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

#12
AmazingGecko

AmazingGecko

    Newbie

  • Member
  • 17 posts
  • Joined 07-November 12
  • OS:Windows 7 x86
  • Country: Country Flag
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

#13
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag
Yes, I use also like this!

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

Edited by myselfidem, 25 December 2012 - 02:14 PM.

For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#14
myselfidem

myselfidem

    Member

  • Member
  • PipPipPipPipPipPipPipPip
  • 2,559 posts
  • Joined 06-January 10
  • OS:Windows 7 x64
  • Country: Country Flag

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
Spoiler







For Windows 7 OS: SetProductKey.rar (fr-FR/en-US. Integrate keys).

#15
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,810 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
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, 28 December 2012 - 04:40 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users