Jump to content

Run $OEM$ from a Floppy?


Recommended Posts


Here is an example using my first test file
@ECHO OFF
%~dp0cmdow @ /HID

:: Renaming Admin account
%~dp0renuser.exe Administrator "IT Manager"

:: Internet Explorer Settings
REG ADD "HKCU\......taken out for space reasons

GOTO :EOF

I just stuck both renuser.exe and cmdow.exe on the floppy

I thought I knew just about everything there was to know about batch scripting, but i don't recognize the %~dp0 that starts 2 of your command lines. What purpose do es that string serve, or is it just a typo error generated through copy and paste?

Link to comment
Share on other sites

no use whatsoever in this case!

It basically references the drive:\path of the running batch file i.e

:: Renaming Admin account

A:\renuser.exe Administrator "IT Manager"

of course this should work exactly the same as

:: Renaming Admin account

renuser.exe Administrator "IT Manager"

It is something I have a habit of adding, it helps me just in case I stray into another location in my batch.

Link to comment
Share on other sites

Ok... I have a question... If i try to use the Yzöwl technique, do i need to Convert all my tweaks.reg to a reg add in a batch file? Reg add are not easy to use like *.reg files.

Windows Registry Editor Version 5.00


;=============[keyboard layout]=================================================================
[HKEY_CURRENT_USER\Control Panel\International\Geo]
"Nation"="39"
[-HKEY_CURRENT_USER\Keyboard Layout\Preload]
"2"="0000040c"
[HKEY_CURRENT_USER\Keyboard Layout\Preload]
"1"="00000c0c"


[HKEY_USERS\.DEFAULT\Control Panel\International\Geo]
"Nation"="39"
[-HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]
"2"="0000040c"
[HKEY_USERS\.DEFAULT\Keyboard Layout\Preload]
"1"="00000c0c"

;-----[cacher barre de langue]-----
[HKEY_CURRENT_USER\Software\Microsoft\CTF\LangBar]
"ShowStatus"=dword:00000003
[HKEY_USERS\.DEFAULT\Software\Microsoft\CTF\LangBar]
"ShowStatus"=dword:00000003


;=============PROPRIETE DE L'AFFICHAGE=================================================================
;-----[effet de fondu]-----
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoChangeAnimation"=dword:00000001

;-----[Disable the Desktop Cleanup Wizard]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanupWiz]
"NoRun"=dword:00000001


;=============PROPRIETE SYSTEME========================================================================
;-----[Disables Error Reporting, but notifies when errors occur]-----
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PCHealth\ErrorReporting]
"DoReport"=dword:00000000


;=============OPTIONS FICHIERS=========================================================================
;-----[Do not use Simple File Sharing]-----
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa]
"forceguest"=dword:00000000


;-----[FILES OPTIONS]-----
[HKEY_USERS\.DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"StartMenuAdminTools"="YES"
"HideFileExt"=dword:00000000
"IntelliMenus"="No"
"Hidden"=dword:00000001
"SuperHidden"=dword:00000001
"ShowSuperHidden"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"StartMenuAdminTools"="YES"
"HideFileExt"=dword:00000000
"IntelliMenus"="No"
"Hidden"=dword:00000001
"SuperHidden"=dword:00000001
"ShowSuperHidden"=dword:00000000


;=============DIVERS================================================================================
===

;-----[Disables SYSTEM RESTORE]-----
;[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore]
;"DisableSR"=dword:00000001


;-----[Disables Windows Tour bubble popup]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]
"RunCount"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Applets\Tour]
"RunCount"=dword:00000000


;-----[Removes Sign up with Passport Wizard when trying to sign in MSN Messenger]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Passport]
"RegistrationCompleted"=dword:00000001


;-----[Enable Num Lock]-----
[HKEY_USERS\.DEFAULT\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"
[HKEY_CURRENT_USER\Control Panel\Keyboard]
"InitialKeyboardIndicators"="2"


;-----[Force Classic Control Panel Display Style]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"ForceClassicControlPanel"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"ForceClassicControlPanel"=dword:00000001


;-----[Classic Search]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"Use Search Asst"="no"
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState]
"Use Search Asst"="no"


;-----[Displays My Computer My Network Places and My Documents on the Desktop]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu]
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel]
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=dword:00000000
"{208D2C60-3AEA-1069-A2D7-08002B30309D}"=dword:00000000
"{871C5380-42A0-1069-A2EA-08002B30309D}"=dword:00000000
"{450D8FBA-AD25-11D0-98A8-0800361B1103}"=dword:00000000

;Disable Autoupdates
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update]
"AUOptions"=dword:00000001
"AUState"=dword:00000007

;============MENU DEMARRER============================================================================
;-----[NoRecentDocsmenu removes the recent documents from the start menu]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"NoRecentDocsMenu"=dword:00000001


;-----[Change MenuShowDelay]-----
[HKEY_CURRENT_USER\Control Panel\Desktop]
"MenuShowDelay"="2"


;-----[CLASSIC START MENU]-----
;[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
;"NoSimpleStartMenu"=dword:00000001
;[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
;"NoSimpleStartMenu"=dword:00000001


;=============TASKBAR===============================================================================
===
;-----[DONT GROUP IN TASKBAR]-----
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"TaskbarGlomming"=dword:00000000
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"TaskbarGlomming"=dword:00000000


[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop]
"TaskbarWinXP"=hex:0c,00,00,00,08,00,00,00,02,00,00,00,00,00,00,00,b0,e2,2b,d8,\
 64,57,d0,11,a9,6e,00,c0,4f,d7,05,a2,22,00,1c,00,0a,10,00,00,1a,00,00,00,01,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,4c,00,00,00,01,14,02,00,00,00,\
 00,00,c0,00,00,00,00,00,00,46,81,00,00,00,11,00,00,00,9c,ff,a0,c8,9d,fb,c3,\
 01,56,bd,1f,88,a1,fb,c3,01,96,c2,21,d1,9d,fb,c3,01,00,00,00,00,00,00,00,00,\
 01,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,02,14,00,1f,50,e0,4f,d0,\
 20,ea,3a,69,10,a2,d8,08,00,2b,30,30,9d,19,00,2f,43,3a,5c,00,00,00,00,00,00,\
 00,00,00,00,00,00,00,00,00,00,00,00,00,5c,00,31,00,00,00,00,00,59,30,25,66,\
 10,00,44,4f,43,55,4d,45,7e,31,00,00,44,00,03,00,04,00,ef,be,59,30,28,33,59,\
 30,25,66,14,00,00,00,44,00,6f,00,63,00,75,00,6d,00,65,00,6e,00,74,00,73,00,\
 20,00,61,00,6e,00,64,00,20,00,53,00,65,00,74,00,74,00,69,00,6e,00,67,00,73,\
 00,00,00,18,00,36,00,31,00,00,00,00,00,59,30,26,66,10,00,4a,75,6c,69,65,00,\
 22,00,03,00,04,00,ef,be,59,30,25,66,59,30,26,66,14,00,00,00,4a,00,75,00,6c,\
 00,69,00,65,00,00,00,14,00,64,00,31,00,00,00,00,00,59,30,2c,66,13,00,41,50,\
 50,4c,49,43,7e,31,00,00,4c,00,03,00,04,00,ef,be,59,30,25,66,59,30,2d,66,14,\
 00,36,00,41,00,70,00,70,00,6c,00,69,00,63,00,61,00,74,00,69,00,6f,00,6e,00,\
 20,00,44,00,61,00,74,00,61,00,00,00,40,73,68,65,6c,6c,33,32,2e,64,6c,6c,2c,\
 2d,32,31,37,36,35,00,18,00,42,00,31,00,00,00,00,00,59,30,26,66,14,00,4d,49,\
 43,52,4f,53,7e,31,00,00,2a,00,03,00,04,00,ef,be,59,30,26,66,59,30,2a,66,14,\
 00,00,00,4d,00,69,00,63,00,72,00,6f,00,73,00,6f,00,66,00,74,00,00,00,18,00,\
 52,00,31,00,00,00,00,00,59,30,2c,66,10,00,49,4e,54,45,52,4e,7e,31,00,00,3a,\
 00,03,00,04,00,ef,be,59,30,26,66,59,30,2c,66,14,00,00,00,49,00,6e,00,74,00,\
 65,00,72,00,6e,00,65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,\
 00,72,00,00,00,18,00,48,00,31,00,00,00,00,00,59,30,31,66,11,00,51,55,49,43,\
 4b,4c,7e,31,00,00,30,00,03,00,04,00,ef,be,59,30,2a,66,59,30,31,66,14,00,00,\
 00,51,00,75,00,69,00,63,00,6b,00,20,00,4c,00,61,00,75,00,6e,00,63,00,68,00,\
 00,00,18,00,00,00,10,00,00,00,05,00,00,a0,1a,00,00,00,23,01,00,00,60,00,00,\
 00,03,00,00,a0,58,00,00,00,00,00,00,00,6f,65,6d,2d,71,70,67,77,6b,74,77,31,\
 72,76,34,00,a6,ac,a4,6f,58,a2,b8,45,ad,48,e5,c8,86,48,06,a9,b1,db,ae,9e,94,\
 67,d8,11,82,5b,00,02,3f,6d,ec,1c,a6,ac,a4,6f,58,a2,b8,45,ad,48,e5,c8,86,48,\
 06,a9,b1,db,ae,9e,94,67,d8,11,82,5b,00,02,3f,6d,ec,1c,00,00,00,00,00,00,00,\
 00,60,07,00,00,00,00,00,00,1e,00,00,00,00,00,00,00,00,00,00,00,1e,00,00,00,\
 00,00,00,00,01,00,00,00,01,00,00,00,aa,4f,28,68,48,6a,d0,11,8c,78,00,c0,4f,\
 d9,18,b4,0c,03,00,00,60,0d,00,00,00,00,00,00,1e,00,00,00,00,00,00,00,00,00,\
 00,00,1e,00,00,00,00,00,00,00,01,00,00,00
"Toolbars"=hex:11,00,00,00,00,00,00,00
"Upgrade"=dword:00000001

Link to comment
Share on other sites

not necessarily, as long as regedit is working that early in the install you could add this to the cmd file and put tweaks.reg in the root of the floppy too

:: Adding Tweaks
REGEDIT /S %~dp0tweaks.reg

Once again the %~dp0 shouldn't be necessary, but it does make it look more complicated :)

Link to comment
Share on other sites

no use whatsoever in this case!

It basically references the drive:\path of the running batch file i.e

:: Renaming Admin account

A:\renuser.exe Administrator "IT Manager"

If I am understanding this correctly, if the batch file were being run from the CD (E:\Install\ for example) then %~dp0 would convert to E:\Install\, even if the batch were originally called from a batch in another location.

Am I right about this? If so, it will make my life much easier by not having to include the CDROM variable if statements in all of the batch files I use for installing my uA programs.

Link to comment
Share on other sites

%~dp0 would convert to E:\Install\

I believe there's ways to get it to pick only the first 2 characters of the path, so that you can add the rest of the folders.....

And also, if you did need to run setups from CD, then why won't %CD% (with ..\..\ and such, for parent dirs) do it better?

Link to comment
Share on other sites

Maybe I didn't explain myself properly. I was talking about installing programs from the CD during an uA install of Windows. Some of the apps that I want to install don't install nicely all on their own, and so I've had to create some custom scripts to get them to install silently the way I want them to.

Here's a sample script.

cmdow @ /HID
FOR %%d IN (D E F ... X Y Z) DO IF EXIST %%d:\WIN51 SET CDROM=%%d:

start %CDROM%\Install\Apps\DaemonTools\awxDTools.exe /S
start /wait %CDROM%\Install\Apps\DaemonTools\KillAwx.cmd
exit

This script sits in the same place as the installer and the other script that it calls. Using %~dp0 I should be able to greatly condense this script, like so:

start %~dp0awxDTools.exe /S
start /wait %~dp0KillAwx.cmd
exit

Needless to say, this is much shorter than the original. It may not seem like much, but spread across several scripts, that space could add up in a hurry. Besides, every byte counts. :D

Link to comment
Share on other sites

That would be correct in a method to condense the code, but as in the previous case, it should also work as

start awxDTools.exe /S
start /wait KillAwx.cmd
exit

The batch should as a matter of course, be checking in it's own directory, if no path is given.

Like I said, most of the time it is fairly pointless, it's more of a habit of mine due to my generally poor organisational skills.

Link to comment
Share on other sites

  • 2 weeks later...
Ok... I have a question... If i try to use the Yzöwl technique, do i  need to Convert all my tweaks.reg to a reg add in a batch file? Reg add are not easy to use like *.reg files.

As an additional note to my previous response to this question, if the reg file merge procedure doesn't yet work at that stage of the install, you could use the same idea at a later stage of the install, using this in the winnt.sif instead

[SetupParams]
  UserExecute = "REGEDIT /S A:\tweaks.reg"

Hope this sorts it for you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...