No announcement yet.

my .cmd works a treat. would like AMS to run the commands.

  • Filter
  • Time
  • Show
Clear All
new posts

  • my .cmd works a treat. would like AMS to run the commands.

    Hi guys.

    Working on a Windows 7 image mount project.
    Adding drivers, updates and the like into a Win 7 install.wim file.

    Usually I just use a simple .cmd file

    dism /mount-wim /wimfile:%~dp0install.wim\install.wim /index:1 /mountdir:%~dp0mount

    Folder layout is

    C:\DISM\install.wim ( where the install.wim file will go )
    C:\DISM\mount ( where the image will be mounted to )

    right clicking on my .cmd file mounts the image a treat.

    I am having problems with trying to run the DISM.exe using


    With a heap load of help from Ulrich I got my extract .iso image working using

    isofound = Dialog.FileBrowse(true, "Locate File", _DesktopFolder, "iso images (*.iso)|*.iso|", "", "iso", false, true);local sCmdLineArgs = "x \"" .. isofound[1] .. "\" -y -o\"" .. "C:\\DISM\\7zip\\files" .. "\"";
    Shell.Execute("C:\\DISM\\7zip\\7z.exe", "open", sCmdLineArgs, "", 0, true)

    With that in mind I have been trying but failing miserably to amend it to fit my DISM command.

    I just don't know which bit goes where. Tried all sorts of connotations and nowt works.

    When run the command window pops up, it will show an error but does not stay on screen long enough to see what the error is.

    Two things I need help with.

    How do I make the command window stay open till I close it to see the error. Or make the window tell me what the error is via a text doc or another way.

    Can anybody see where I am going wrong with my script\code and how to amend it.

    My last failed attempt was

    local sCmdLineArgs = "mount-wim" .. "Wimfile:C:\\DISM\\Install.wim\\install.wim //index:1 //mountdir:C:\\DISM\\mount" .. "\"";
    Shell.Execute("Dism.exe", "open", sCmdLineArgs, "", SW_SHOWNORMAL, false)


  • #2
    At a first quick look seems you are making a bit of confusion while escaping slashes and backslashes

    Backslash "\" must be always escaped, not only in file paths, so. "\\".

    Normal slashes must not be escaped, so: "/".

    Also, if you need to use brackets inside a string, you should use combination of simple brackets and double brackets:

    Wrong way: "My cat is named "Toby" and is white"

    Correct ways:
    "my cat is named 'Toby' and is white" or
    'my cat is named "Toby" and is white'
    We are slowly invading your planet to teach lazy humans to read the user manual.
    But don't be scared: we are here to help.


    • #3
      Cheers for the reply.

      I still can not get it.

      Seeing I know my .cmd works I will just have AMS point to that.

      My head hurts....


      • #4
        I finally worked it out...

        I have done it..

        Took me ages. But I do get side tracked very easily and move onto other things. I have left this alone and just tonight come back to it.

        After looking very very closely at a "command Line" project example I downloaded I finally got my DISM code to work by just using AMS.

        It did work and my "input1" showed the the command line final output, a job complete statement.

        You have no idea how good that made me feel. So I tested it on various other DISM commands and they all worked very well.
        Ohhh happy days.


        The DISM command of mounting an install.wim does take a good few minutes, maybe about 5 or so.
        While this happens my AMS project just hangs, tells me it is NOT RESPONDING.
        Then after the mounting process is finished I get the "operation Complete" message in my "input1"

        So How could I stop my project from hanging and giving errors.

        If nobody is familiar with DISM and mounting images when the command is issued the dism.exe jumps into life and the command window has a progress bar of how long the process is taking.

        I sort of expected the complete process of the command window showing in my input1 window but it did not, only the end complete message.

        Is there a way to show the entire command window.

        or is there a way to add an AMS progress bar to a process taking a long time.

        Pretty happy but a long way to go yet.

        any input would be appreciated .


        • #5
          Indeed it did take ages, over a year, did you sleep?


          • #6
            Originally posted by Shrek View Post
            Indeed it did take ages, over a year, did you sleep?
            Funny you should say that.
            One minute I was spinning yarn, I remember pricking my finger then after that I don't know..