Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2014-04-28
4
Medium Priority
?
1,886 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 2000 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Using the Hyper-V Manager requires administrator rights. This guide shows how to add shortcuts and Start Screen tiles for normal users to quickly connect to local virtual machines rather than using the recommended Remote Desktop connection.
Security measures require Windows be logged in using Standard User login (not Administrator).  Yet, sometimes an application has to be run “As Administrator” from a Standard User login.  This paper describes how to create a shortcut icon to launch a…
The goal of this Micro Tutorial is to help navigate beginning users with the app store on Windows 8. It will explain exciting features how to maximize your PC through these apps. This will be demonstrated using Windows 8 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Suggested Courses
Course of the Month13 days, 12 hours left to enroll

963 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