none
Can Convert-WindowsImage convert a .WIM from Command Prompt's "recimg" on Windows 8.1? RRS feed

  • Question

  • Hi Folks,

    I have been trying to do this several times, including with the UI. The UI afforded a bit more info; it was complaining about the .WIM metadata:

    **********************
    Windows PowerShell transcript start
    Start time: 20140121155929
    Username : TammyLacey\Crysta T Lacey
    Machine : TAMMYLACEY (Microsoft Windows NT 6.3.9600.0)
    **********************
    INFO : Launching UI...
    INFO : Selected Working Directory is D:\Hyper-V\Virtual Hard Disks...
    INFO : Scanning WIM metadata...
    INFO : Scanning WIM metadata...
    ERROR : You cannot call a method on a null-valued expression.
    INFO : Log folder is C:\Users\CRYSTA~1\AppData\Local\Temp\Convert-WindowsImage\28986a7f-dc96-4ee6-91e2-b69b90a31153
    INFO : Closing Windows image...
    INFO : Done.
    **********************
    Windows PowerShell transcript end
    End time: 20140121161513
    **********************

    With PowerShell: 

    PS C:\Windows\system32> Convert-WindowsImage -SourcePath "E:\@.RefreshImage\2014-01-18\CustomRefresh.wim" -VHDPath "D:\Hyper-V\Virtual Hard Disks\W 8.1 Pro 1.vhdx" -Edition Professional -VHDFormat VHDX -Verbose -db

    **********************
    Windows PowerShell transcript start
    Start time: 20140121092326
    Username : TammyLacey\Crysta T Lacey
    Machine : TAMMYLACEY (Microsoft Windows NT 6.3.9600.0)
    **********************
    DEBUG:
    using System;

    using System.Collections.Generic;

    using System.Collections.ObjectModel;

    using System.ComponentModel;

    using System.Globalization;

    using System.IO;

    using System.Linq;

    using System.Runtime.InteropServices;

    using System.Security;

    using System.Text;

    using System.Text.RegularExpressions;

    using System.Threading;

    using System.Xml.Linq;

    using System.Xml.XPath;

    using Microsoft.Win32.SafeHandles;



    namespace WIM2VHD {



    /// <summary>

    /// P/Invoke methods and associated enums, flags, and structs.

    /// </summary>

    public class

    NativeMethods {



    #region Delegates and Callbacks

    #region WIMGAPI



    ///<summary>

    ///User-defined function used with the RegisterMessageCallback or UnregisterMessageCallback function.

    ///</summary>

    ///<param name="MessageId">Specifies the message being sent.</param>

    ///<param name="wParam">Specifies additional message information. The contents of this parameter depend on the
    value of the

    ///MessageId parameter.</param>

    ///<param name="lParam">Specifies additional message information. The contents of this parameter depend on the
    value of the

    ///MessageId parameter.</param>

    ///<param name="UserData">Specifies the user-defined value passed to RegisterCallback.</param>

    ///<returns>

    ///To indicate success and to enable other subscribers to process the message return WIM_MSG_SUCCESS.

    ///To prevent other subscribers from receiving the message, return WIM_MSG_DONE.

    ///To cancel an image apply or capture, return WIM_MSG_ABORT_IMAGE when handling the WIM_MSG_PROCESS message.

    ///</returns>

    public delegate uint

    WimMessageCallback(

    uint MessageId,

    IntPtr wParam,

    IntPtr lParam,

    IntPtr UserData

    );



    public static void

    RegisterMessageCallback(

    WimFileHandle hWim,

    WimMessageCallback callback) {

    >>>>>>>>>>>>>>>>>> I have the rest of the DEBUG your interested but it is over 4000 lines<<<<<<<<<<<<<<<

    #endregion Public Properties

    }



    #endregion VHD Interop

    }

    Confirm
    Continue with this operation?
    [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"):
    VERBOSE: isUserAdmin? True
    VERBOSE: isWindows8? True
    VERBOSE: Temporary VHDX path is : D:\Hyper-V\Virtual Hard Disks\e53a41bc-6a5e-4d85-9b77-33d0e48b40b8.vhdx
    ERROR : You cannot call a method on a null-valued expression.
    INFO : Log folder is C:\Users\CRYSTA~1\AppData\Local\Temp\Convert-WindowsImage\e53a41bc-6a5e-4d85-9b77-33d0e48b40b8
    INFO : Closing Windows image...
    INFO : Done.
    **********************
    Windows PowerShell transcript end
    End time: 20140121093332
    **********************

    Thank You,


    Best Regards,

    Crysta


    PhotM Phantom of the Mobile

    Wednesday, January 22, 2014 12:26 AM

Answers

All replies

  • I am sure none of us can guess at what you are trying to ask.

    Can you please just tell us what error you are getting?  I really don't feel like decoding a bunch of transcripts.


    ¯\_(ツ)_/¯

    Wednesday, January 22, 2014 12:41 AM
  • I have to assume that y'all know about the MS recimg.exec for the Command Prompt and PowerShell in Windows 8.x, that creates a .WIM for Refresh/Recovery purposes. Should Convert-WindowsImage.ps1, an MS Employee script upgrade to WIM2VHD.wsf (for W 7 and less) for W 8.x and greater, convert the recimg .WIM image. I  have no idea how much clearer I can be. The Convert-WindowsImage.ps1 WEBPage directs one here for support.

    As is stated just above; ERROR : You cannot call a method on a null-valued expression. 

    That is all I am getting from the script too. I have looked through the the program some as well as the Debug but I haven't programmed for 30 years so very much out of my depth. the best addition info I can come up with is there are some WIM Metadate problem, thus why I framed my question the way I did. For some reason that even though the Script has .WIM imagefile opened it is still returning a "null-value".

    So far, that is the best I can do,

    Crysta


    PhotM Phantom of the Mobile

    Wednesday, January 22, 2014 1:41 AM
  • What is recimg.exec?  It is not a program.

    What subsystem is this part of or did you just download it from the internet?

    We cannot guess at what you are asking.

    The file here http://gallery.technet.microsoft.com/scriptcenter/Convert-WindowsImageps1-0fe23a8f

    is not written by Microsoft.  As such you need to post in the Q&A for the script and let the author answer your question.


    ¯\_(ツ)_/¯

    Wednesday, January 22, 2014 2:10 AM
  • (W 8.1 Pro) C:\Windows\System32\recimg.exe FOR Command Prompt or PowerShell which is part of the Microsoft  Windows 8.1 Pro Eco system. NO, It is not 3rd party or other MS Kits or Packages. 

    I have not used the Recimg .WIM on a USB. http://windows.microsoft.com/en-us/windows-8/create-usb-recovery-drive

    I found out about it from here at Gizmo's http://www.techsupportalert.com/content/make-your-windows-881-computer-act-new-refresh-feature.htm

    Hope this helps,

    Crysta


    PhotM Phantom of the Mobile

    Wednesday, January 22, 2014 2:42 AM
  • Oh - recimg.exe and not recimg.exec.

    What does this have to do with scripting?


    ¯\_(ツ)_/¯

    Wednesday, January 22, 2014 2:57 AM
  • I think there are a couple of Red Hariings are forming here. First, I am of the old IBM school where filetypes (extentions) were limited to 8 characters not 3 as in DOS in the 70's & 80's, therefore Executives were Exec but the same as .exe and were text files. Second, this is not about recimg ability to run, it runs just fine but slow. Recimg is simply where the .WIM comes from. 

    This is about Convert-WindowsImage.ps1 a PowerShell Script processing that .WIM and converting it to a .vhdx.

    Crysta


    PhotM Phantom of the Mobile

    Wednesday, January 22, 2014 3:51 AM
  • I highly doubt the author of the script is going to see this thread.

    As suggested above, you really should post questions on the QandA tab of the script to get any meaningful response.


    Don't retire TechNet! - (Don't give up yet - 12,575+ strong and growing)

    Wednesday, January 22, 2014 4:17 AM
  • I think there are a couple of Red Hariings are forming here. First, I am of the old IBM school where filetypes (extentions) were limited to 8 characters not 3 as in DOS in the 70's & 80's, therefore Executives were Exec but the same as .exe and were text files. Second, this is not about recimg ability to run, it runs just fine but slow. Recimg is simply where the .WIM comes from. 

    This is about Convert-WindowsImage.ps1 a PowerShell Script processing that .WIM and converting it to a .vhdx.

    Crysta


    PhotM Phantom of the Mobile

    Herrings dear - 'herrings'.  Or are you thinking of "harangue-ings"... maybe "hangings'.

    I am an extremely old IBM guy.  Windows extensions can have as many characters as you need.  There is no 3 character limit as any trained technician in IBM or Windows has known for many years.

    If you have a real question post it to the location where you got the script.  The script is from the Gallery. 

    We do not fix or write scripts on demand.  You are free to write a script and post questions here.  If you have issues with  gallery scripts then post to the author of the script.


    ¯\_(ツ)_/¯

    Wednesday, January 22, 2014 4:21 AM