cmdlines.txt + .reg files - installed into OEm folder..New to this,need help..

Discussion in 'Windows 7' started by tnx, Feb 9, 2011.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    Hi guys....Well tn here messing again and trying to do summet new. Well new to me,feel sure guys on here will have the know how...

    Been doing many many new installs of W7 and there are a couple of things i do when ever i do a fresh install. One is to disable the windows animation on minimize\maximise and the other is to get rid of the shortcut arrows.

    To get rid of the shortcut arrows i use a Blank.ico file and a .reg file. I downloaded these two but i have been reading up on how to write my own .reg file to do this.

    To disable the windows aniamtion i usually go into advanced system settings and untab it. But yesterday i learned how to do it in regedit. Then i learnt to write my own .reg file to do this....It worked a treat.

    from one of my previous threads i learnt how to add a hosts file into $OEM$\$$\SYSTEM32\drivers\etc - - -and my new ammended file is there from a fresh install....Brilliant.

    But i kept reading and i wanted to add the .reg files to run as Windows was installing.
    I got my .reg file and Blank.ico file and put them into $OEM$\$$ - -along with a new file to me "cmdlines.txt" first time i have come across one. I made through Notepad a .txt file looking like this

    [Commands]
    "REGEDIT /S HideArrow.reg"

    HideArrow is the name of the .reg file...

    this is where i dont know what i am doing,making this here cmdlines.txt file....
    i tested an install of W7x64 with my OEM folder added to Sources with all the usuall info plus the .reg file etc...
    After the install had finished my Blank.ico and the HideArrow.reg files wer installed into C:\Windows but the .reg file had not run cause a new shortcut had the arrow there. I ran the .reg file manually from inside C:\Windows and rebooted making the arrow diaspear...
    Summet had gone wrong and i am guessing my cmdlines.txt file is the problem...I have never made one before and i must have got it wrong..This is where i need help.

    So if your still reading this,understanding it and can offer me help,please do..

    Cheers....

    Plus how to make more than one .reg file install as windows is installing...
     
  2. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    Forgot to add....I have tried using RT7Lite to add .reg files. But i am increasingly falling out with that APP....It takes for ever to do tasks.....and just crashes out on me.
    So i thought there has to be a better way....So i want to learn the manual way of doing this...

    Just need help and advice...
     
  3. Kouryu

    Kouryu MDL Senior Member

    Jan 19, 2011
    408
    111
    10
    of course windows is going to ignore the .txt file
    you need to make it a batch/script file... it needs to be either .bat or .cmd
    this is a prime example of the importance of correct file name extensions, using them properly, and the reason for them
     
  4. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60

    Ok....

    This is it you see...I do NOT know this....I thank you for the advice....

    So. I run Notepade as administrator,type my text

    [Commands]
    "REGEDIT /S HideArrow.reg"

    The save as "cmdlines.cmd"

    Would this then run my .reg file as windows installs.....

    How then would i get multi .reg files to run...Just type more commands under each other or sepperate docs ?????????

    Great...
     
  5. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    I ave just opened my OEM folder and saved the cmndlines.txt as .cmd...

    Look at the attached pic...Does this look right now...
    Forget the cmdlines.txt file. Will delete this...
     

    Attached Files:

  6. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,884
    20,224
    180
    tnx you can add the commands you want to call from "oobe.cmd" in scripts directory, ie:

    HideArrow.reg in scripts directory

    @echo off

    REGEDIT /S %~dp0"HideArrow.reg"

    Exit
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60


    Ahhhhhhhhhhhhhhhh...You know i have never looked at that file..Just done so...Mine looks like this

    @echo off

    start /w regedit /s %systemroot%\setup\scripts\oem.reg
    del /F /Q %systemroot%\setup\scripts\oem.reg
    if not exist %systemroot%\panther mkdir %systemroot%\panther
    if not exist %systemroot%\panther\unattend.xml copy %systemroot%\setup\scripts\oem.xml %systemroot%\panther\unattend.xml
    call %systemroot%\setup\scripts\slp.cmd
    del /F /Q %systemroot%\setup\scripts\slp.cmd


    :Cleanup
    del /F /Q %systemroot%\setup\scripts\oobe.cmd

    Would i just pop my test in under "del /F /Q %systemroot%\setup\scripts\slp.cmd"

    Then just keep adding lines foa as many .reg files i want ??


    Cheers guys..


    Listen. Summet silly. I am off to work now.Will pick this up later...Sorry and it is just getting good...

    :biggrin:
     
  8. urie

    urie Moderator
    Staff Member

    May 21, 2007
    8,707
    3,064
    300
    @ tnx, yes just add you script before :Cleanup, also you keep referring to cmdlines.txt that is only used with windows XP for unattended installs nothing to do with vista or windows seven there is also rather than oobe.cmd you can use Setupcomplete.cmd and windows 7 will always run that as last cmd or batch file.
     
  9. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    #9 tnx, Feb 10, 2011
    Last edited: Feb 10, 2011
    (OP)

    ohhhhhhhhhhhhhhh......I thought i was doing ok but need to have a re-think.

    Setupcomplete.cmd ???? Where do i find this...

    oobe.cmd ? If i had the text
    REGEDIT /S %~dp0"HideArrow.reg"

    to the oobe.cmd where would i put the .reg file and the blank.ico file ?? Would they still sit in $OEM$\$$ ????.... reading again they go in the SCRIPTS folder...

    I am gunna text this this morning and see what happens...

    Thanks to all for the tips...

    I recon i will be shouting for more help.....
     
  10. Kouryu

    Kouryu MDL Senior Member

    Jan 19, 2011
    408
    111
    10
    you need to add a line to copy the blank.ico to a specific location... then your reg file will have to point to it... after that it should work
     
  11. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60


    Ok....Would not know how to write this....Can you show me an example please...
     
  12. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,884
    20,224
    180
    #12 Alphawaves, Feb 10, 2011
    Last edited by a moderator: Apr 20, 2017
    If you want to use setupcomplete.cmd then open notepad and copy 'n' paste the following code:

    Code:
    @echo off
    
    IF EXIST "%~dp0Blank.ico" (
       IF NOT EXIST "%systemroot%\Blank.ico" (
       COPY /Y "%~dp0Blank.ico" "%systemroot%\Blank.ico" >nul
      )
    )
    IF EXIST "%~dp0HideArrow.reg" (
        regedit /s "%~dp0HideArrow.reg" >nul
    )
    
    exit
    
    save as SetupComplete.cmd, put it along with your 'HideArrow.reg' file and 'blank.ico' inside the scripts directory of your $oem$ folder

    ;)
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  13. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60

    Well firsrtly thanks for that mate.....
    I will not pretend to understand it fully.
    %systemroot% - - - - -Is this C:\Windows ?
    COPY /Y - - - - - What is the Y for ?

    And this is puzzling me %~dpo - - - - -What exactly does this mean ?
    I understand regedit /s - - - -This means installs silently. Does it ?


    I am off to try this right now ( well in a minute )

    I have just completed a fresh install but it failed to get rid of the shortcut arrow from the begining. The files were actually waiting there in C:\Windows and when the .reg file was manually clicked on and the PC rebooted it worked...So i am still going wrong somewhere...

    Cheers for the help....:biggrin:
     
  14. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,884
    20,224
    180
    #14 Alphawaves, Feb 10, 2011
    Last edited: Feb 10, 2011
    C:\windows = %systemroot%

    COPY /Y = copy file (replace existing file)

    regedit /s = (regedit, silent switch)

    %~dpo = current location, ie: same directory/location of file its being called from.

    Make sure the location of blank.ico in reg file is the same location it is being sent to in setupcomplete.cmd

    Can you copy 'n' paste your setupcomplete.cmd here also your reg file bro..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60

    Well alphawaves....
    I copied your text and made a setupcomplete.cmd file. Put it in Scripts along with the .reg and .ico file.
    I have just completed one more fresh install of W7x64. I went into C:\Windows and there was the Blank.ico file....
    I went to "My Documents" and sent it to the desktop as a shortcut...

    Wait for it....Wait......

    :worthy: :worthy: :worthy: :worthy: :worthy:

    yessssssssssssssssssssssssssss...NO shortcut arrow....

    Brillianty...Exactly what i wanted. And really so simple...

    Thank you very much..

    Infact thanks for all the input guys. I love this forum...

    ohhhhh thanks for the run down of what they meant too. Gunna copy this and make a note of it....

    One more question. I want to add another .reg file into the mix. I have a .reg file ( which i wrote,god i'm on fire ) which disbles the windows aniamtion on minimize\maximise. Do i just add the new txt as follows

    @echo off

    IF NOT EXIST "%systemroot%\Blank.ico" (
    COPY /Y "%~dp0Blank.ico" "%systemroot%\Blank.ico"
    )
    IF EXIST "%~dp0HideArrow.reg" (
    regedit /s "%~dp0HideArrow.reg"
    )
    regedit /s "%~dpoDisableAnimation.reg

    exit


    Would this work. And to go further would each and every new .reg file just follow on underneath each other.



    ohhhhhhhhh i just thought of summet i have always fancied doing. Having my fav's already in "My Favourites" from a fresh install.

    If i added a Folder called "My Favourites" into the SCRIPTS folder and added summet like,
    COPY /Y "%systemroot%\Users\Malc's\My Favourites
    Would that work. Or just simply NO WAY...

    :biggrin:
     
  16. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,884
    20,224
    180
    #16 Alphawaves, Feb 10, 2011
    Last edited by a moderator: Apr 20, 2017
    Cool :)

    Code:
    regedit /s "%~dp0DisableAnimation.reg"
    You can copy/create to favourites like:

    Make directory:
    Code:
    MD "%USERPROFILE%\Favorites\Malc'sFolder"
    Copy file:
    Code:
    copy /y "%~dp0Malc's.file" "%USERPROFILE%\Favorites\Malc'sFolder"

    NOTE: If you want to run multiple reg files just add the reg files to scripts folder and use this code instead of the others to run them:
    Code:
    IF EXIST "%~dp0*.reg" (
       FOR /F "tokens=*" %%A IN ('DIR /B  "%~dp0*.reg"') DO (
          regedit /s "%~dp0%%A"
       )
    )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    #17 tnx, Feb 10, 2011
    Last edited by a moderator: Apr 20, 2017
    (OP)

    Thanks for those....Making notes of them now...
     
  18. tnx

    tnx MDL Expert

    Sep 2, 2008
    1,618
    232
    60
    @ alphawaves.....

    I have a couple more questions for you....

    Using the setupcomplete.cmd can you delete files. ?
    Can you make shortcuts of folders on the desktop ? i.e create "My Documents" shortcut on the desktop ?

    Is there a list of all the commands you can do ?
     
  19. Trinket

    Trinket MDL Senior Member

    Feb 20, 2010
    487
    169
    10
    Hey tnx,

    Now that AlphaWaves has you covered for the integrated tweaks, I made you a "!RemoveArrow" and "!RestoreArrow" that you can run on an already installed system WITHOUT having to log on/off or reboot.

    Just extract the .7z files linked to below, and run the "Run.cmd" files inside the folders. The .cmd contains code to refresh explorer.exe and rebuild the icon database, which will properly refresh the icons for your system (sometimes even log off/on won't properly do this).

    These will come in handy when you wish to apply these tweaks to already installed systems where you don't have the luxury of creating a new build/install. Works every time ;)


    Download:

    !RemoveArrow: mediafire.com/?yhh27aeirb2y9tl

    !RestoreArrow: mediafire.com/?axypnyggykvcoe0
     
  20. Alphawaves

    Alphawaves Super Moderator/Developer
    Staff Member

    Aug 11, 2008
    5,884
    20,224
    180
    #20 Alphawaves, Feb 10, 2011
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...