^_^ Posted April 28, 2005 Posted April 28, 2005 nice work I busted my a** trying to convert all the codes and batch files to work from a floppyand now I'm the only one left using batch files
FeTT! Posted April 28, 2005 Author Posted April 28, 2005 Ill tests the 2 methods today..Thx alots for your help!
Cartoonite Posted April 28, 2005 Posted April 28, 2005 Here is an example using my first test file@ECHO OFF%~dp0cmdow @ /HID:: Renaming Admin account%~dp0renuser.exe Administrator "IT Manager":: Internet Explorer SettingsREG ADD "HKCU\......taken out for space reasonsGOTO :EOFI just stuck both renuser.exe and cmdow.exe on the floppy<{POST_SNAPBACK}>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?
Yzöwl Posted April 28, 2005 Posted April 28, 2005 no use whatsoever in this case!It basically references the drive:\path of the running batch file i.e:: Renaming Admin accountA:\renuser.exe Administrator "IT Manager"of course this should work exactly the same as:: Renaming Admin accountrenuser.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.
FeTT! Posted April 29, 2005 Author Posted April 29, 2005 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
Yzöwl Posted April 29, 2005 Posted April 29, 2005 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 TweaksREGEDIT /S %~dp0tweaks.regOnce again the %~dp0 shouldn't be necessary, but it does make it look more complicated
Cartoonite Posted April 29, 2005 Posted April 29, 2005 no use whatsoever in this case!It basically references the drive:\path of the running batch file i.e:: Renaming Admin accountA:\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.
Yzöwl Posted April 29, 2005 Posted April 29, 2005 Yes!The ~dp0 will reference the drive and path of the 'batch called', not the 'calling batch'.
prathapml Posted April 30, 2005 Posted April 30, 2005 %~dp0 would convert to E:\Install\<{POST_SNAPBACK}>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?
Cartoonite Posted April 30, 2005 Posted April 30, 2005 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 @ /HIDFOR %%d IN (D E F ... X Y Z) DO IF EXIST %%d:\WIN51 SET CDROM=%%d:start %CDROM%\Install\Apps\DaemonTools\awxDTools.exe /Sstart /wait %CDROM%\Install\Apps\DaemonTools\KillAwx.cmdexitThis 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 /Sstart /wait %~dp0KillAwx.cmdexitNeedless 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.
Yzöwl Posted April 30, 2005 Posted April 30, 2005 That would be correct in a method to condense the code, but as in the previous case, it should also work asstart awxDTools.exe /Sstart /wait KillAwx.cmdexitThe 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.
Yzöwl Posted May 9, 2005 Posted May 9, 2005 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.<{POST_SNAPBACK}>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!
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now