Jump to content

Recommended Posts

Posted (edited)

how do i use run once

can i just run a reg file through it or does it need to be through a batch command

how would i run a reg file through a batch command through runonce

is there any place that shows the commands used for adding deleting running ect in a batch file

also how would i organize the start menu by moving shortcuts and deleting other unneeded items

Edited by b-man

Posted (edited)

ok but i need more commands than that or dont understand it still

how 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 directory

and create a shortcut

is there a tutorial on how to do these things through runonce

and where would i place the files so that they can be copied over

Edited by b-man
Posted

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, etc

In 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...

post-12166-1243417074_thumb.png

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.exe

Finally make sure OemPreinstall is set to enabled in the nLite unattended section so that the $OEM$ folder contents get copied over.

Posted (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 OR

2. a batch command like this (make a folder plugins in $OEM$):

REM Copy Azareus Plugin
copy %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 by Sp0iLedBrAt
Posted (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.cmd

REM Copy Azureus Plugins
copy %source%\$OEM$\Azureus\plugins "%programfiles%\Azureus"

REM Copy Azureus Settings
copy %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.cmd

ok 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% directory

and the folder contents of settings(being a folder called Azureus) into the %appdata% directory

both overwriting any previous files?? and would that do it silently

how would i add it to a bulk run once cmd file using the example from the forum website

cmdow @ /HID
@echo off

SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /V TITLE /D "Installing Applications" /f

REG ADD %KEY%\005 /VE /D "Adobe Reader 6" /f
REG ADD %KEY%\005 /V 1 /D "%systemdrive%\install\AdobeReader6\AR6.msi /qn" /f

REG ADD %KEY%\010 /VE /D "Alcohol 120" /f
REG ADD %KEY%\010 /V 1 /D "%systemdrive%\install\alcohol\setup.exe /qn" /f
REG ADD %KEY%\010 /V 2 /D "REGEDIT /S %systemdrive%\install\alcohol\register.reg" /f

REG ADD %KEY%\015 /VE /D "Diskeeper 8" /f
REG ADD %KEY%\015 /V 1 /D "%systemdrive%\install\DiskeeperPro_8.0.459.exe /s /v/qn" /f

REG ADD %KEY%\050 /VE /D "Importing Registry Tweaks" /f
REG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemdrive%\install\regtweaks.reg" /f

REG ADD %KEY%\055 /VE /D "Cleaning Up and Rebooting" /f
REG ADD %KEY%\055 /V 1 /D "%systemdrive%\install\cleanup.cmd" /f

EXIT

and whats /v*, /ve, /d and /f

Edited by b-man
Posted
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 /f
Console Registry Tool for Windows - version 3.0

Copyright © Microsoft Corp. 1981-2001. All rights reserved

REG 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 prompt

Examples:

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?

Posted (edited)

never mind i worked that out

so 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 nlite

meant to go here

;			Settings						
;7-Zip Settings
REG ADD HKCU\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001 /f
REG ADD HKCU\Software\7-Zip\Options /v ContextMenu /t REG_DWORD /d 00000306 /f

or would this work so every user has the same settings

;			Settings						
;7-Zip Settings
REG ADD HKU\.DEFAULT\Software\7-Zip\Options /v CascadedMenu /t REG_DWORD /d 00000001 /f
REG 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" /f
REG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemdrive%\install\regtweaks.reg" /f

do 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 Plugins
copy %source%\$OEM$\Azureus\plugins "%programfiles%\Azureus"

REM Copy Azureus Settings
copy %source%\$OEM$\Azureus\settings "%appdata%\Azureus"

Edited by b-man
Posted (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 by 5eraph
Posted (edited)

is this a valid runonce cmd file?? what do i have to change to make it work

i 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 something

RunOnce.cmd.txt

Edited by b-man
Posted (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 /f
REG 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 /f

REG ADD \"HKCR\*\shell\Open with notepad\command /v (Default) /t REG_SZ /d "Notepad.exe""%1"\" \025 /f

REG 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" /F
REG 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" /F

REG ADD %KEY%\025 /V 1 /D "REG ADD \"HKCR\*\shell\Open with notepad\command\" /VE /d \"Notepad.exe \\\"%%1\\\"\" /f" /F

REG 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 by 5eraph
Posted

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. :)

Posted

I seem to have overdone the percentage signs. I have revised the code above to make the necessary corrections. :)

Posted (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...

edit

ok they didnt work like they were will try the updated 1s and report back, thanks for them btw

1 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 once

also 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 by b-man

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...