Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Firefox seemed to slow down recently and it occurred to me that I had many open tabs — ultimately, I would find out that three-quarters of them were Experts Exchange tabs! :) So I decided to go on a hunt for a tool that would capture the names an…
No matter the version of Windows you are using, you may have some problems with Windows Search running too slow or possibly not running at all. Before jumping into how you can solve this issue, just know there are many other viable alternative deskt…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.

705 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