Jump to content

Recommended Posts

Posted

Could someone post some sample code using XCOPY in RunOnceEx to copy over a file and/or directory please? When XCOPY copies a file does it remove read-only attributes? Thanks


Posted

XKnoppix, i found this site very usefull when i need dos commands and switches, how it helps.

Dos commands

xcopy /e /k /i /c /r /y "%CDROM%\Software\Favorites\"*.* "%systemdrive%\Documents and Settings\Administrator\Favorites\"
Posted

u don't really need websites to find the usage

go into dos prompt

type xcopy /?

it will give u the instructions.

if u want to read it later or have it on a notepad file or something

type xcopy /? >>xcopyhelp.txt

this will create a xcopyhelp.txt file for u to look over, print etc....

xcopy normally resets the read only /hidden /system stuff so use /K to preserve the file attributes.

also if u want to change the attributes on a file also in dos u can type attrib /? and see the list of commands on how to change it...

Posted

In RunOnceEx, you need to add 'cmd.exe /C' to the XCOPY command as follows:

REG ADD %KEY%\075 /V 01 /D "cmd.exe /C\"XCOPY \"%CD%\NSW2003\MSDOS\*.*\" \"%allusersprofile%\Application Data\Symantec\Ghost\Template\Common\MSDOS\*.*\" /E /I /Q /H /R /Y\"\"" /f

Posted

@Frank_Sechrist

Okay :) I didn't understand one thing you said?!?

I don't see those lines in anyone elses RunOnceEx.cmd file when they use XCOPY, what does it do?

Thanks

Posted

well if u don't have anything looking like that in runonceex u're probably doing something else?

reg add %key%\### /v 01 /D "etc etc etc " /f should definitely be there....

post your cmd here...

Posted

By the way could someone post some code for my RunOnceEx file?

For example:

%systemdrive%\install\Applications\CDRWIN\cdrwin.dat

to

C:\CDRWIN3\

Thanks

Posted

RunOnceEx.cmd

cmdow @ /HID
@echo off

REG DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v RunOnceEx /f >NUL

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

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

REG ADD %KEY%\010 /VE /D "ATI Drivers" /f
REG ADD %KEY%\010 /V 1 /D "%systemdrive%\install\Applications\ATI\Driver\Setup.exe -s -f1%systemdrive%\install\Applications\ATI\Driver\setup.iss" /f

REG ADD %KEY%\020 /VE /D "ATI Control Panel" /f
REG ADD %KEY%\020 /V 1 /D "%systemdrive%\install\Applications\ATI\Control\Setup.exe -s -f1%systemdrive%\install\Applications\ATI\Control\setup.iss" /f

REG ADD %KEY%\030 /VE /D "Adobe Acrobat Reader" /f
REG ADD %KEY%\030 /V 1 /D "%systemdrive%\install\Applications\AdobeReader6\AR6.msi /QN" /f

REG ADD %KEY%\040 /VE /D "Microsoft .Net Framework" /f
REG ADD %KEY%\040 /V 1 /D "%systemdrive%\install\Applications\NetFramework\netfx.msi /QN" /f

REG ADD %KEY%\050 /VE /D "Nero Burning Rom" /f
REG ADD %KEY%\050 /V 1 /D "REGEDIT /S %systemdrive%\install\Applications\Nero\register.reg" /f
REG ADD %KEY%\050 /V 2 /D "%systemdrive%\install\Applications\Nero\Nero6009.exe /no_ui /silent /noreboot" /f

REG ADD %KEY%\060 /VE /D "Windows Media Player 9" /f
REG ADD %KEY%\060 /V 1 /D "%systemdrive%\install\Applications\WMP9\MPSetupXP.exe /Q:A /R:N" /f

REG ADD %KEY%\070 /VE /D "Registering Video Codecs" /f
REG ADD %KEY%\070 /V 1 /D "regsvr32.exe %systemroot%\system32\xvid.ax /s" /f
REG ADD %KEY%\070 /V 2 /D "regsvr32.exe %systemroot%\system32\divxdec.ax /s" /f
REG ADD %KEY%\070 /V 3 /D "regsvr32.exe %systemroot%\system32\ac3filter.ax /s" /f

REG ADD %KEY%\080 /VE /D "Registering mIRC" /f
REG ADD %KEY%\080 /V 1 /D "REGEDIT /S %systemdrive%\install\Applications\mIRC\register.reg" /f

REG ADD %KEY%\090 /VE /D "MSN Messenger 6.1" /f
REG ADD %KEY%\090 /V 1 /D "%systemdrive%\install\Applications\MSN\MsnMsgs.msi /QN" /f

REG ADD %KEY%\100 /VE /D "WinRAR 3.30" /f
REG ADD %KEY%\100 /V 1 /D "%systemdrive%\install\Applications\WinRAR\wrar330.exe /s" /f

REG ADD %KEY%\110 /VE /D "Hauppauge WinTV Drivers" /f
REG ADD %KEY%\110 /V 1 /D "%systemdrive%\install\Applications\WinTV\whql337_21163.exe /s" /f
REG ADD %KEY%\110 /V 2 /D "taskkill.exe /F /IM whql337_21163.exe" /f

REG ADD %KEY%\120 /VE /D "CDRWIN 3.9f" /f
REG ADD %KEY%\120 /V 1 /D "%systemdrive%\install\Applications\CDRWIN\cdrwin.exe /s" /f

REG ADD %KEY%\130 /VE /D "**** NFO Viewer" /f
REG ADD %KEY%\130 /V 1 /D "%systemdrive%\install\Applications\****\****.msi /QN" /f

REG ADD %KEY%\140 /VE /D "Longhorn Transformation Pack" /f
REG ADD %KEY%\140 /V 1 /D "%systemdrive%\install\Applications\Longhorn\Longhorn Transformation Pack.exe /s" /f
REG ADD %KEY%\140 /V 2 /D "taskkill.exe /F /IM Longhorn Transformation Pack.exe" /f

REG ADD %KEY%\150 /VE /D "Applying Registry Tweaks" /f
REG ADD %KEY%\150 /V 1 /D "REGEDIT /S %systemdrive%\install\RegTweaks.reg" /f

REG ADD %KEY%\160 /VE /D "Enabling Windows File Protection" /f
REG ADD %KEY%\160 /V 1 /D "REGEDIT /S %systemdrive%\install\Applications\Longhorn\wfp.reg" /f

REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /V Cleanup /D "%systemdrive%\cleanup.cmd"

EXIT

Posted (edited)

hmm well that's wierd

u just need to add this to any part of that cmd file???

REG ADD %KEY%\170 /VE /D "copy" /f

REG ADD %KEY%\170 /V 1 /D "cmd.exe /C\"XCOPY \"%CD%\NSW2003\MSDOS\*.*\" \"%allusersprofile%\Application Data\Symantec\Ghost\Template\Common\MSDOS\*.*\" /E /I /Q /H /R /Y\"\"" /f

and for the other question u want cdrwin.dat to be copied to C:\CDRWIN3\ ? right

that u can just do with copy

copy cdrwin.dat c:\cdrwin3\

REG ADD %KEY%\180 /VE /D "copy2 " /f

REG ADD %KEY%\180 /V 1 /D "cmd.exe /C\"COPY \"%CD%\cdrwin.dat\" \"c:\cdrwin3\\" \\"\"" /f

something like that

but i see u have not set the %cd% path in there u've to do that.

i really have to go now, i saw the pm at the last second...

later...

Edited by XtremeMaC
Posted

I still don't get what these lines do?

REG ADD %KEY%\170 /VE /D "copy" /f
REG ADD %KEY%\170 /V 1 /D "cmd.exe /C\"XCOPY \"%CD%\NSW2003\MSDOS\*.*\" \"%allusersprofile%\Application Data\Symantec\Ghost\Template\Common\MSDOS\*.*\" /E /I /Q /H /R /Y\"\"" /f

I don't even have a "%allusersprofile%\Application Data\Symantec\Ghost\Template\Common\MSDOS\ dir on my CD?! Could you explain? Plus if i figure this out i'm going to use XCOPY to replace $Progs and $Docs for read-only error reasons :)

Thanks

Posted

i believe that was an example from someone's runonce file shoing you how to use it.

the reasoning behind cmd.exe /C is that XCOPY is a MSDOS command that can only be used form the command promp.

cmd.exe /C sends a line of batch code to the command interpreter. It'd be like creating a batch file, but this is only doing one line instead of creating a whole nother file.

Everything after that is the command you want to run...

%CD% is current directory. You may wish to change that to reflect what you want to do.

%allusersprofile% is a variable pointing to the C:\Documents and Settings\All Users\ directory on your harddrive.

XCOPY usage is...

XCOPY (file/directory to copy from) (file directory to copy to)

for what the switches mean, open a command prompt and type XCOPY /? and it will tell you everything.

Posted

REG ADD %KEY%\170 /VE /D "copy" /f

REG ADD %KEY%\170 /V 1 /D "cmd.exe /C\"XCOPY \"%CD%\NSW2003\MSDOS\*.*\" \"%allusersprofile%\Application Data\Symantec\Ghost\Template\Common\MSDOS\*.*\" /E /I /Q /H /R /Y\"\"" /f

I used the Symantec\Ghost XCOPY as an example. You would have to change the path and file or folder name to suit your situation.

You originally asked how to run XCOPY from RunOnceEx. You have to add the cmd.exe /C in order to do that. Alternatively, you can run XCOPY without the cmd.exe /C from a .cmd file, and call that .cmd file from RunOnceEx.

Posted

don't?

%CD% is Current Directory...

Everything else in your batch has %systemdrive% in it. Just use it instead. You don't have to use everything everyone else uses in your batch.

Posted

Oh :)

I ment to say %CDROM% Isn't it a variable for the CD-ROM and would allow me to run files straight offf the cd rather than copying them to Hard Drive?

Thanks

P.S. Remember "multiple boots"

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