Jump to content

How to import this..........


Recommended Posts

I'm trying to import the following line into registry :

XCOPY /Y "H:\Appz\GAIM\Setting\*.*" "D:\Documents and Settings\Mio\Application Data"

Running from RunOnceEx.cmd with the following line:

REG ADD %KEY%\016 /V 2 /D "XCOPY /Y "\"%CDROM%\Appz\GAIM\Setting\*.* %UserProfile%\Application Data""\ " /f

Will only get this in the registry (missing double quotes):

XCOPY /Y "H:\Appz\GAIM\Setting\*.* D:\Documents and Settings\Mio\Application Data"

Please help me to get the correct line!

Link to comment
Share on other sites


Try something like this:

reg add %KEY%\016 /v 2 /d "%systemroot%\system32\xcopy.exe \"H:\Appz\GAIM\Setting\*.*\" \"D:\Documents and Settings\Mio\Application Data\" /i/q/k/y" /f

It should all be on one line!

<Edit>

Are you sure you are just copying files from inside 'Setting' to 'Application Data'.

I would have expected them to at least be going into a directory.

</Edit>

Edited by Yzöwl
Link to comment
Share on other sites

@Yzöwl

Hahaha....,LOL! I follow the tutorial of RunOnceEx on MSFN strictly and it turn out to be wrong. The tutorial specify that:

You will find that if you add additional " " quotation marks in the REG ADD entries, it won't be imported to the Windows Registry. To work around this, use a backslash \" for every quotation you intend to add, for example:

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

By doing this, you can execute applications that contain spaces in the filename, or application switches that need to be enclosed in quotations.

If there is an application that has a series of complicated switches with lots of quotation marks, consider putting them into a separate .cmd file instead and launching from RunOnceEx, because it would get too messy putting those switches directly into RunOnceEx.

http://unattended.msfn.org/intermediate/me...s/runonceex.htm

The tutorial said "a backslash" but it coloured the backslash and double quote with red. So the correct on should be \ instead of \". Guess I am the only retard cause nobody got it wrong!

You're the man Yzöwl!

BTW, you spot my mistake again. It is to be copy into a folder:

REG ADD %KEY%\016 /V 2 /D "XCOPY \"%CDROM%\Appz\GAIM\.Gaim\*.*\" \"%UserProfile%\Application Data\.Gaim\" /I/K/Q/Y " /f

Thanks again.

Edited by MioKawaii
Link to comment
Share on other sites

Well in that case, your command should still look more like this:

reg add %KEY%\016 /v 2 /d "%systemroot%\system32\xcopy.exe %CDROM%\Appz\GAIM\.Gaim \"%AppData%\" /r/h/i/q/y" /f

Obviously the switches will depend upon your own situation and once again the code should all be on one line.

Link to comment
Share on other sites

@Astalavista

Thank you for your reply. Packing it with an archiever is a good idea if the pupose is only to copy the files to a location but that's just an example of things that I'm trying to do. For instant, insert command lines to the RunOnceEX.cmd to do an installation of 23 Firefox extentions which is previously run from a seperate batch file.

Link to comment
Share on other sites

I think you might have misunderstood what i was trying to say...

REG ADD %KEY%\016 /V 2 /D "XCOPY /Y "\"%CDROM%\Appz\GAIM\Setting\*.* %UserProfile%\Application Data""\ " /f

Everywhere you were adding the \" you added a "\" which is unneccasary and syntactically wrong. Instead think of it more like, "Alright, I need a quote here and here in this command. Alright, let's put those in." Since those quotes are undoubtedly not the outer ones (by this i mean, the one just after the /D and just before the /F) then you'll need to put a \ before them. That's all that the guide was trying to say...

So in this instance, you would need a \ before the quote just after the /Y and a \ just before the quote after Application Data since these are the embedded quotes. It appears you have an extra quote at the end of the line above, which is syntax error and would screw up the importation of the line.

Edited by Alanoll
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...