Can DISM be used to create desktop shorcuts on install ?

Discussion in 'Windows 7' started by tnx, Dec 21, 2013.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Hi. After a bit of help.

    For ages now I have been using a combination of a RUNONCE envoking a .vbs file pointing to a .cmd file which calls XXMKLINK.exe to make shortcuts on my desktop during a fresh install.

    For a short while now I have been using DISM to add the usual drivers, updates and the like but just recently got into adding other stuff via DISM. I.E having MY Computer placed on the desktop during a fresh install along with a whole bunch of other REGEDITS.

    But I can not for the life in me to get the shortcuts to work. Is it even possible ?

    This is how I do it via the $OEM$ folder.

    in the OOBE I have

    The .vbs looks like this

    and finally the .cmd looks like this

    This is what I am doing...Using DISM I am copying the .vbs and the .cmd file into the mounted Windows dir.

    Then I load the reg hive and import this reg

    even tried this

    But It just does not work..

    So can any of the clever folk on here see where I am going wrong. Is it all possible for DISM to be utilised this way ?

    Thanks for reading, hope somebody can help me out.

    o_O
     
  2. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    #2 tnx, Dec 21, 2013
    Last edited: Dec 21, 2013
    (OP)
    Well I don't know if this has owt to do with it but I am gunna give it a go anyway.

    The machine I am testing this out on is an LGA 1155 H61 mobo. Installing W7 x32.

    I have been using my working OS, Win 7 x64 to do the DISM work.
    On a spare drive on my main PC I have installed Win 7 x32 to carry out any further DISM work for my test rig.

    Don't think it really matters but worth testing.


    Well just tested it and that was a waste of time but I sort of knew it was going to be. I had to test it all the same.

    Question.....

    the RUNONCE command. if this is called at the end of an install does the registry log it as been used ?

    Summet wrong somewhere.
     
  3. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Me again....;)

    Just been messing with xxmklink.exe by making a .cmd file
    It did not work...:(

    looked at it, changed it. Looked some more..Did not work :mad::mad::mad:

    Hang on, hang on...I added some
    made this

    saved it as a .cmd.......BINGO....my test worked...:biggrin:

    So now I have to test if adding
    into my original .cmd it may work....

    Only one way to find out...

    I will report back..
     
  4. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Well I am feeling a bit giddy..

    I have just booted up into my Win 7 x32 test drive on my PC.

    Amended my original .cmd file to include the
    Got this

    Right click,run as admin.....BINGO !!!!!!

     
  5. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Well with a fresh install done, it still is not working.

    All the .cmd .vbs and the xxmklink.exe are in Windows so that bit is ok.

    I ran the .vbs file, it pointed to the .cmd file and the shortcuts were made.

    So it has to come down to the runonce reg file. I must have that written wrong.

    Watch this space......;)
     
  6. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,078
    60
    #6 Mr Jinje, Dec 21, 2013
    Last edited by a moderator: Apr 20, 2017
    Modify this.

    Code:
    REG LOAD HKU\ZZZ "C:\Users\Default\NTUSER.DAT"
    REG ADD HKU\ZZZ\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v newUserProfile /t REG_EXPAND_SZ /d "C:\Windows\Shortcuts.vbs" /f
    REG UNLOAD HKU\ZZZ
     
  7. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    #7 tnx, Dec 21, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Cheers for that :)

    I was thinking it was my .reg file

    I have changed it now to

    Doing another fresh install as I type. Feeling confident this is it..

    But looking I may need to omit the
    from the .reg file. Will see what happens..

    :tankyou:


    Once again...Not working...Has to be my reg file.....
     
  8. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Well just looking through my last attempt and saw a flaw in the .reg file to be added to the mounted image.

    It should be

    as below

    So lets do it again...

    Fingers crossed..
     
  9. HALIKUS

    HALIKUS MDL Addicted

    Jul 29, 2009
    527
    369
    30
    #11 HALIKUS, Dec 22, 2013
    Last edited by a moderator: Apr 20, 2017
    in autoit this does it...

    Code:
    FileCreateShortcut("c:\Windows\explorer.exe", @DesktopCommonDir & "\explorer.lnk", "c:\Windows\", @SW_SHOWNORMAL)
    
     
  10. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,078
    60
    #12 Mr Jinje, Dec 22, 2013
    Last edited by a moderator: Apr 20, 2017
    Dumb question, why not just copy the links directly into the default start menu or desktop or wherever they are going. That way they get propagated to all and you don't need a script anymore.

    Code:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs
    
    C:\Users\Default\Desktop
     
  11. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    #13 tnx, Dec 22, 2013
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Let me think....

    Do you mean, mount a image. Create a shortcut for my folders and place the shortcuts in
    unmounts with commit and job done....

    can this be done with dism ?

    hang on summet like

    Not up on that coding probably needs work...Seems easier.

    Is that what you meant ??

    Just tried that...access is denied ????
     
  12. Mr Jinje

    Mr Jinje MDL Expert

    Aug 19, 2009
    1,773
    1,078
    60
    #14 Mr Jinje, Dec 22, 2013
    Last edited: Dec 22, 2013
    or just Right click, create new shortcut. Paste your $user thing in as the target. The links will be generic for all users.

    Right Click > New > Shortcut
    Paste "%USERPROFILE%\Music"
    Click Next > Click Finish.

    copy those files into the wim and you are done.

    In fact, I am assuming you already have copies of these files on your current desktop, why not copy them into your wim by hand. That is the dism way.
     
  13. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Can it be that simple. Surely not.

    I have just made some and put then in the desktop folder.

    Just un-mounting with commit. I will then re-mount and see if they are there....

    NO

    NO

    NO..

    I AM NOT HAVING IT...They are still there....

    It can not be so simple.....:furious:

    Furious at myself...

    right I am gunna test this out...
     
  14. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Nope...

    It's late...

    Bugger it for now..
     
  15. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    I have just tested an install with my custom $OEM$ folder. This has an OOBE file in dir "$oem$\$$\setup\scripts"
    It works perfectly. The OOBE file has a few entries including one regarding my shortcuts.
    So I have amended this OOBE file just to point to my shortcuts.
    I have mounted an image, made a folder in set called scripts and placed this OOBE file in there. Also copied the shortcuts .vbs, .cmd and the xxmklink.exe into the mounted Windows folder.

    Un-mounted with Commit.

    Testing a fresh install as I type.

    If this fails I will just simply go back to making my own $OEM$ folder and updating it my most recent regedits.

    Getting a bit annoyed and bored now with this so it will be my last test and I will leave it alone. For a good while anyway. Probebly be moving onto Windows 8.1 soon anyway.
     
  16. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    Well you'll never guess what just worked. :biggrin5:

    It turned out to be quite simple after all. I was just going about it all wrong and trying to make it difficult.

    :clap3:
     
  17. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,601
    227
    60
    I finally got it just the way I wanted it. Nice and neat with no extra folders needed.

    I left it for a while, usually do if summet bugs me and I can't get it to work.

    Mounted the install.wim

    Loaded the reg hive.

    copied my .vbs, .cmd and xxmklink.exe into the mounted windows folder.

    then I ran regedit to look at the reg , specifically the runonce. Nowt there. Good

    Made this .cmd
    ran it.
    checked the regedit again, runounce and bingo it was there.

    unloaded the reg hive

    unmounts with commit

    tested the install on my test rig and it worked a treat.

    Perfect. just how I wanted to do it...

    FINALLY...:biggrin: