Win10 time zone during setup?

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 17,661
    Windows 10 Pro
       #11

    win10freak said:
    So it does work with Internet connection, but not without.
    Works perfectly for me, regardless if connected to Internet or not.


    win10freak said:
    Where should I add this file for my bootable USB?
    You need to mount the Windows install image, then save this batch file as AnyName.bat (I always use name RunOnce.bat) in MOUNTFOLDER\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup folder:

    Code:
    tzutil /s "Your TimeZone Here"
    del %0

    Steps 3.1 through 3.5 in following tutorial show how to mount a Windows image, step 5.1 how to unmount it saving the changes: DISM - Add or Remove Drivers on an Offline Image

    When newly installed Windows is booted first time to desktop, the first line of that batch file will be run, and time zone will be changed. The second line del %0 then simply deletes the batch file, so it will not be run in subsequent boots.


    win10freak said:
    And I need to convert the install.esd to install.wim first?
    You don't need to convert ESD to WIM, if you do not want to do any offline servicing, like for instance what's told above, adding a batch file in offline image. If you want to / need to do offline servicing, this tutorial shows how to convert an ESD image to WIM image: Convert ESD file to WIM using DISM in Windows 10

    Kari
      My Computer


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #12

    Wow, that's a great solution without the need for an answer file.
      My Computers


  3. Posts : 17,661
    Windows 10 Pro
       #13

    hsehestedt said:
    Wow, that's a great solution without the need for an answer file.
    Yes, that's quite a practical method. Write a batch file to do whatever you want to be done when initial, first user boots to desktop first time. Save it in mounted Windows image in MOUNTFOLDER\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup folder.

    Add del%0 as last line to your batch file. That command deletes the batch file itself, so commands in your batch will be run only once, at first boot to desktop.

    Kari
      My Computer


  4. Posts : 4,187
    Windows 11 Pro, 22H2
       #14

    While we are on the topic, I was recently trying to figure out how I could run a batch file like that on first time auto logon and get it to log me off at the end and delete itself.

    Problem is that if you put the command "logoff" first, it will log you off before it gets to the "del%0" command and it won't delete itself. If you reverse the order then the file deletes itself before it logs you off.

    I finally discovered that you can combine multiple commands on a single line and both will execute like this:

    "logoff & del%0"

    I know this is a bit off topic but I just thought that it was a cool little trick.
      My Computers


  5. Posts : 812
    Win10
    Thread Starter
       #15

    Used the Windows Answer File Generator to create my answer file

    I think it’s a good place for beginners
      My Computer


  6. Posts : 17,661
    Windows 10 Pro
       #16

    win10freak said:
    Used the Windows Answer File Generator to create my answer file

    I think it’s a good place for beginners
    No, it's not.

    It is surprisingly often that when a member comes here and asks about why his / her answer file is not working, we then find out that he / she has used an answer file generator.

    I know it sounds vain, but I do not know how to say it in a modest way: One of the best guides for beginners to create answer files for Windows deployment and installation is here: Create media for automated unattended install of Windows 10

    Kari
      My Computer


  7. Posts : 812
    Win10
    Thread Starter
       #17

    Thanks, but the time zone issue got resolved by the generator. I left all the defaults.

    Your right, I need to take some time reading the more advanced stuff.

    Can I practice on a virtual machine like on Virtual Box? So if something goes wrong then I would not have to keep reinstalling my main computer.
      My Computer


  8. Posts : 17,661
    Windows 10 Pro
       #18

    win10freak said:
    Can I practice on a virtual machine like on Virtual Box? So if something goes wrong then I would not have to keep reinstalling my main computer.
    Short: yes.

    I always use Hyper-V virtual machines to build and customize my deployment images. In fact, using a VM as a reference machine is in my opinion the "correct" way. When image is then ready, I can deploy it to real, physical machines.

    Kari
      My Computer


  9. Posts : 812
    Win10
    Thread Starter
       #19

    In my current answer file, can I just leave the <TimeZone>UTC<TimeZone> and delete everything else?

    Can you post an example on how an answer file would look like if I want to just use the time zone setting and I can do the rest of setup manually?
      My Computer


  10. Posts : 4,187
    Windows 11 Pro, 22H2
       #20

    EDIT June 21, 2020: My posting below contains errors. Please see post # 27 in this thread for an explanation of what is wrong and a corrected answer file.

    Below is an example with only the timezone set. Note that in my example I use "UTC". Replace this with whatever you like. For a list of valid timezone names, run "tzutil /L" from a command prompt.

    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <unattend xmlns="urn:schemas-microsoft-com:unattend">
        <settings pass="specialize">
            <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                <TimeZone>UTC</TimeZone>
            </component>
        </settings>
        <cpi:offlineImage cpi:source="wim://hysteria/crucial_ssdfiles/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
    </unattend>
    Save the file as "autounattend.xml" and place it ion the root of your installation media. Note that I was assuming Windows 10 Pro when I made this file. With this file, Windows setup will still be same same as a normal manual install, it will only set the timezone for you automatically.

    TIP: You can place the answer file on the root of any drive accessible during setup as Windows will scan all disks for this file. As a result, you can create a seperate ISO image with just this file and connect it as a second DVD drive on a VM if you don't want to put it on your Windows image.
    Last edited by hsehestedt; 21 Jun 2020 at 01:18.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:35.
Find Us




Windows 10 Forums