b-man Posted May 26, 2009 Posted May 26, 2009 (edited) how do i use run oncecan i just run a reg file through it or does it need to be through a batch commandhow would i run a reg file through a batch command through runonceis there any place that shows the commands used for adding deleting running ect in a batch filealso how would i organize the start menu by moving shortcuts and deleting other unneeded items Edited May 26, 2009 by b-man
iamtheky Posted May 26, 2009 Posted May 26, 2009 http://unattended.msfn.org/unattended.xp/view/web/31/
b-man Posted May 27, 2009 Author Posted May 27, 2009 (edited) ok but i need more commands than that or dont understand it stillhow do i copy some files over i have a azureus silent installer and i want to copy over some plugins to the install directory but also copy my settings to the %appdata%\azureus directoryand create a shortcut is there a tutorial on how to do these things through runonceand where would i place the files so that they can be copied over Edited May 27, 2009 by b-man
Guest Posted May 27, 2009 Posted May 27, 2009 Use $OEM$ folders and WinRar SFX archives. I do something similar so I'll give you an example.Let's take the folder structure of my theoretical XP CD...MYXPCD-i386-%OEM%--$1 <---- stuff in $1 will be copied over to the operating system drive---finalize <--- in here i but my batch, reg, winrar sfx archives, etcIn my finalize folder above I place a file called FirefoxProfile.exe that will silently extract to my %appdata% folder. Here's how..Firefoxprofile.exe is a WinRar SFX archive and I'll let a picture explain it better than words can... My profile.ini gets copied over to my %AppData%\Mozilla\Firefox\ directory!As for shortcuts, WinRar has that ability too. I'm not very familiar with is but if u press the help button in the Advanced SFX Options > Add Shortcut tab, it will be explained to you.In nLite, go to the unattended, runonce tab and add this command -> %SystemDrive%\finalize\FirefoxProfile.exeFinally make sure OemPreinstall is set to enabled in the nLite unattended section so that the $OEM$ folder contents get copied over.
Sp0iLedBrAt Posted May 27, 2009 Posted May 27, 2009 (edited) Two ways:1. In the $OEM$ folder create folders $docs\documents and settings\user name(or all users, depends where the folder is)\application data\azareus and put the files inside OR2. a batch command like this (make a folder plugins in $OEM$):REM Copy Azareus Plugincopy %source%\$OEM$\plugins\nameofplugin "%systemdrive%\Documents and Settings\username(or [i]all users[/i], depends where the folder is)\azareus"work out the correct folder names and it should work, and in both ways you don't need a reg file. (for the batch command line, use the inverted commas, they are necessary)-X- is right, WinRAR also works very well. Edited May 27, 2009 by Sp0iLedBrAt
b-man Posted May 28, 2009 Author Posted May 28, 2009 (edited) anything i have used winrar for i just turned into an addon and it worked. so basicly the same urs is a bit of a neater idea and wouldnt cause problems where my way could. in winrar is there a way to copy 1 folder to %appdata% and 1 folder to %programfiles% azureus.cmdREM Copy Azureus Pluginscopy %source%\$OEM$\Azureus\plugins "%programfiles%\Azureus"REM Copy Azureus Settingscopy %source%\$OEM$\Azureus\settings "%appdata%\Azureus"and place the azureus.cmd file into %source%\$OEM$\azureus.cmd ? and then the run once command in nlite $OEM$\azureus.cmdok so if i done that, would that copy the folder contents of plugins(being a folder called plugins) into the folder Azureus in the %programfiles% directoryand the folder contents of settings(being a folder called Azureus) into the %appdata% directoryboth overwriting any previous files?? and would that do it silentlyhow would i add it to a bulk run once cmd file using the example from the forum website cmdow @ /HID@echo offSET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Installing Applications" /fREG ADD %KEY%\005 /VE /D "Adobe Reader 6" /fREG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\AdobeReader6\AR6.msi /qn" /fREG ADD %KEY%\010 /VE /D "Alcohol 120" /fREG ADD %KEY%\010 /V 1 /D "%systemdrive%\install\alcohol\setup.exe /qn" /fREG ADD %KEY%\010 /V 2 /D "REGEDIT /S %systemdrive%\install\alcohol\register.reg" /fREG ADD %KEY%\015 /VE /D "Diskeeper 8" /fREG ADD %KEY%\015 /V 1 /D "%systemdrive%\install\DiskeeperPro_8.0.459.exe /s /v/qn" /fREG ADD %KEY%\050 /VE /D "Importing Registry Tweaks" /fREG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemdrive%\install\regtweaks.reg" /fREG ADD %KEY%\055 /VE /D "Cleaning Up and Rebooting" /fREG ADD %KEY%\055 /V 1 /D "%systemdrive%\install\cleanup.cmd" /fEXITand whats /v*, /ve, /d and /f Edited May 28, 2009 by b-man
Guest Posted May 28, 2009 Posted May 28, 2009 in winrar is there a way to copy 1 folder to %appdata% and 1 folder to %programfiles%You could if you include a batch file that WinRar then executes after it extracts but then its not winrar doing it. It's best to run 2 SFX archives.and whats /v*, /ve, /d and /fConsole Registry Tool for Windows - version 3.0Copyright © Microsoft Corp. 1981-2001. All rights reservedREG ADD KeyName [/v ValueName | /ve] [/t Type] [/s Separator] [/d Data] [/f] KeyName [\\Machine\]FullKey Machine Name of remote machine - omitting defaults to the current machine Only HKLM and HKU are available on remote machines FullKey ROOTKEY\SubKey ROOTKEY [ HKLM | HKCU | HKCR | HKU | HKCC ] SubKey The full name of a registry key under the selected ROOTKEY /v The value name, under the selected Key, to add /ve adds an empty value name <no name> for the key /t RegKey data types [ REG_SZ | REG_MULTI_SZ | REG_DWORD_BIG_ENDIAN | REG_DWORD | REG_BINARY | REG_DWORD_LITTLE_ENDIAN | REG_NONE | REG_EXPAND_SZ ] If omitted, REG_SZ is assumed /s Specify one charactor that you use as the separator in your data string for REG_MULTI_SZ. If omitted, use "\0" as the separator /d The data to assign to the registry ValueName being added /f Force overwriting the existing registry entry without promptExamples: REG ADD \\ABC\HKLM\Software\MyCo Adds a key HKLM\Software\MyCo on remote machine ABC REG ADD HKLM\Software\MyCo /v Data /t REG_BINARY /d fe340ead Adds a value (name: Data, type: REG_BINARY, data: fe340ead)The middle part of your post is very hard to read. Can you rephrase it?
b-man Posted May 29, 2009 Author Posted May 29, 2009 (edited) never mind i worked that outso could i add this to the run once area (the run once in nlite) or the runonce.cmd i am creating? or do i copy the text from the runonce.cmd to the run once area in nlitemeant to go here; Settings ;7-Zip SettingsREG ADD HKCU\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001 /fREG ADD HKCU\Software\7-Zip\Options /v ContextMenu /t REG_DWORD /d 00000306 /for would this work so every user has the same settings; Settings ;7-Zip SettingsREG ADD HKU\.DEFAULT\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001 /fREG ADD HKU\.DEFAULT\Software\7-Zip\Options /v ContextMenu /t REG_DWORD /d 00000306 /f are these correct?REG ADD %KEY%\050 /VE /D "Importing Registry Tweaks" /fREG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemdrive%\install\regtweaks.reg" /fdo i have to put the 050 there or not? and does it need a heading with the /VE /D "heading"if i can leave it as the runonce.cmd can i put this in it ??REM Copy Azureus Pluginscopy %source%\$OEM$\Azureus\plugins "%programfiles%\Azureus"REM Copy Azureus Settingscopy %source%\$OEM$\Azureus\settings "%appdata%\Azureus" Edited May 29, 2009 by b-man
Guest Posted May 29, 2009 Posted May 29, 2009 (edited) Nevermind. I misunderstood the question.But, yes, you do need 050, or something like it. The /VE registry entry is not required. The command will still execute, but without displaying an entry onscreen. Edited May 29, 2009 by 5eraph
b-man Posted May 30, 2009 Author Posted May 30, 2009 (edited) is this a valid runonce cmd file?? what do i have to change to make it worki removed cmdow \hide and turned echo on and ran it sandboxed and recieved "Error: too many command-line parameters" for any file i was trying to create a registry file for(7zip,reshack,open with notepad ect) instead of just importing 1 how do i create a reg file or import 1 with a variable %systemdrive% instead of c:\and will it run regsvr32.exe and register the dll files? or do i need to change somethingRunOnce.cmd.txt Edited May 30, 2009 by b-man
Guest Posted May 30, 2009 Posted May 30, 2009 (edited) I'm not familiar with SetLocal, so there's nothing meaninful I can say about that.But the following commands:REG ADD \"HKU\.DEFAULT\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001\" \005 /fREG ADD \"HKU\.DEFAULT\Software\7-Zip\Options /v ContextMenu /t REG_DWORD /d 00000306\" \005 /f[...]REG ADD \"HKCR\*\shell\Reshack\command /v (Default) /t REG_SZ /d "%ProgramFiles%\Reshack\ResHacker.exe" "%1"\" \020 /fREG ADD \"HKCR\*\shell\Open with notepad\command /v (Default) /t REG_SZ /d "Notepad.exe""%1"\" \025 /fREG ADD \"HKCR\MSInfo.Document\Shell\Open\Command /v (Default) /t REG_SZ /d "%ProgramFiles%\Nfo Viewer\nfoview.exe" "%1"\" \030 /f...should be:REG ADD %KEY%\005 /V 1 /D "REG ADD HKU\.DEFAULT\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001 /f" /FREG ADD %KEY%\005 /V 2 /D "REG ADD HKU\.DEFAULT\Software\7-Zip\Options /v ContextMenu /t REG_DWORD /d 00000306 /f" /F[...]REG ADD %KEY%\020 /V 1 /D "REG ADD HKCR\*\shell\Reshack\command /VE /t REG_EXPAND_SZ /d \"%%ProgramFiles%%\Reshack\ResHacker.exe \\\"%%1\\\"\" /f" /FREG ADD %KEY%\025 /V 1 /D "REG ADD \"HKCR\*\shell\Open with notepad\command\" /VE /d \"Notepad.exe \\\"%%1\\\"\" /f" /FREG ADD %KEY%\030 /V 1 /D "REG ADD HKCR\MSInfo.Document\Shell\Open\Command /VE /t REG_EXPAND_SZ /d \"\\\"%%ProgramFiles%%\Nfo Viewer\nfoview.exe\\\" \\\"%%1\\\"\" /f" /F Edited May 30, 2009 by 5eraph
b-man Posted May 30, 2009 Author Posted May 30, 2009 set local is to run from cd instead of copying everything to the hard drive http://unattended.msfn.org/unattended.xp/view/web/59/thanks ill copy that and c so many %%% and \\\\ how do u learn all that?
Guest Posted May 30, 2009 Posted May 30, 2009 It took me a long time to understand. Here is a simple explanation:Certain characters are translated differently when they're part of a command line. Those characters are the double quotation mark ("), the backslash (\) and the percent sign (%). To make certain that they survive through nesting, where one command runs another, they must be "escaped." The backslash (\) is used for this purpose and is known as an escape character. When a double quotation mark (") must survive through one iteration you use the escape character before it (\").But when a double quotation mark (") must survive two iterations—as shown in the code example above—the escape character itself must be escaped, (\\). So you'd use (\\\") to make certain one double quotation mark survives two iterations.The percent sign (%) is a different type of character. They are used as part of environment variables, which themselves are translated immediately at the command line to the values they've been assigned through the SET command. To prevent an environment variable from being translated immediately, it is necessary to escape the percent signs around it. They are escaped by doubling them. So, to make certain one percent sign survives one iteration you'd double it once (%%). One percent sign through two iterations means you'd double it twice (%%%%). Three times: (%%%%%%%%). I think you get the picture.
Guest Posted May 30, 2009 Posted May 30, 2009 I seem to have overdone the percentage signs. I have revised the code above to make the necessary corrections.
b-man Posted May 30, 2009 Author Posted May 30, 2009 (edited) oh crap just installing it now lol oh well ill have to make another version when the other things arnt right cheers will copy them again and try again altho it did say when i tested after i added that everything worked successfully hmm...editok they didnt work like they were will try the updated 1s and report back, thanks for them btw1 thing my run once didnt work but after i had logged in and rebooted it worked shouldnt it work the first time i log into my user? i placed %source%\runonceex.cmd into nlites run oncealso the netframework 2 and 3.5 i have doesnt seem to work it runs and installs but is showing its not installed even after reboot Edited May 30, 2009 by b-man
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now