Solved

SetupComplete.cmd after sysprep unattend - %ProgramFiles% syntax for Win 8.1

Posted on 2014-04-28
4
1,724 Views
Last Modified: 2014-04-29
I want to adapt the following SetupComplete.cmd file for Windows 8.1 64 bit:

del /F /Q %WINDIR%\Panther\unattend.xml
del /F /Q %WINDIR%\System32\Sysprep\unattend.xml

%WINDIR%\System32\cscript.exe %WINDIR%\System32\slmgr.vbs /ato
%windir%\system32\cscript.exe "%ProgramFiles%\Microsoft Office\Office15\ospp.vbs" /act

This script was written for Win 7 32 bit PCs.  

I have not tried to use it with Win 8.1 64 bit because it looks like it will fail with the variable %ProgramFiles%.  I don't know much about variables, but I know ospp.vbs is in Program Files (x86) and not Program Files.

Secondly, I cannot actually find %ProgramFiles% in the list of variables under advanced system settings.

As I say I know very little about environmental variables.

Do I need to modify this script?
Why does the %ProgramFiles% variable not appear to already exist?
0
Comment
Question by:Alistair7
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Red-King earned 500 total points
ID: 40027531
If you open up a command promt and type in the word "set" you will be shown all the environment variables available on the system.

Which variable to use depends on whether its a 32bit or 64bit  version of Office in the image.
32bit: %ProgramFiles(x86)%
64bit: %ProgramFiles%

Rory
0
 

Author Comment

by:Alistair7
ID: 40027582
Brilliant Rory

I used "set" and  %ProgramFiles(x86)% does in fact exist! (I'll use this in the script.)

Why on earth does it not show up under Advanced system settings?
0
 
LVL 9

Expert Comment

by:Red-King
ID: 40029003
I'm not quite sure. I think it may have something to do with the order in which the variables are defined which is talked about in this Technet blog post;
http://technet.microsoft.com/en-us/magazine/jj853254.aspx
First is the default pre-defined Windows Variables, then the System Variables section (I'm thinking Computer Account related for these), then pre-defined User variables and lastly user-defined User variables (User Account related for these).

The %Programfiles% and %Programfiles(x86)% variables would appear to be in the pre-defined User variables, %Systemroot% in the default pre-defined Windows variables.
What I'm inferring from the blog post, the pre-defined variables don't show up in the Advances System settings because they're not dependent on either the computer or user account.

All conjecture but it's the best I can come up with.
Rory
0
 

Author Closing Comment

by:Alistair7
ID: 40029751
Thanks a lot Rory.
You give very clear and detailed responses.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Samsung SSD 840 EVO and 840 EVO mSATA have a well-known problem with a drop in read performance. I first learned about this in an interesting thread here at Experts Exchange: http://www.experts-exchange.com/Hardware/Storage/Hard_Drives/Q_2852…
Sometimes a user will call me frantically, explaining that something has gone wrong and they have tried everything (read - they have messed it up more and now need someone to clean up) and it still does no good, can I help them?!  Usually the standa…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question