Solved

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

Posted on 2014-04-28
4
1,752 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to load print drivers 3 97
Activation Keys added before or after Sysprep 1 315
0ffice 2016 not printing 6 164
Measure time after installing Antivirus 8 96
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…
If you use NetMotion Mobility on your PC and plan to upgrade to Windows 10, it may not work unless you take these steps.
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

734 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