Solved

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

Posted on 2014-04-28
4
1,597 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks a lot Rory.
You give very clear and detailed responses.
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Detailed instructions on how to install an Access add-in in recent versions of Office and Windows (with screen shots)
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
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.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

743 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now