Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

winrar sfx code to copy files to \%userprofile%\Application

- - - - -

  • Please log in to reply
12 replies to this topic

#1
dub

dub
  • Member
  • 5 posts
  • Joined 15-September 10
  • OS:none specified
  • Country: Country Flag
Hi how you input the code in winrar sfx to extract & copy certain files to C:\Documents and Settings\%userprofile%\Application Data ? in Windows XP / Vista / Seven

The sfx application requires a profile.xml file to be in the C:\Documents and Settings\%username%\Application Data folder

Or do i need to create a .cmd file? If yes how?

Please advise. Thanks ahead =)


How to remove advertisement from MSFN

#2
radix

radix

    Friend of MSFN

  • Member
  • PipPipPipPipPip
  • 755 posts
  • Joined 08-February 07
  • OS:Windows 8 x64
  • Country: Country Flag
Select the files to add in a sfx archive, right click on selection->WinRAR->Add to archive...->check Create sfx archive->Advanced->SFX Options->in path to extract fill with
%APPDATA%
, click OK, click OK. Also you can adjust compression if necessary.


Edited by radix, 16 September 2010 - 08:21 AM.


#3
dub

dub
  • Member
  • 5 posts
  • Joined 15-September 10
  • OS:none specified
  • Country: Country Flag
Thanks for the reply radix

I meant only the profile.xml file alone is extracted or copied to C:\Documents and Settings\%username%\Application Data folder

The rest of the files in SFX archive is extracted to the sfx default output folder - "program files" folder

I don't know what additional sfx scripts commands is required to input on the sfx comment section

Or create a run.cmd file to do the profile.xml file copying & add " /w run.cmd " without quotes after this sfx command script Setup=software.exe

Example;

Setup=software.exe /w run.cmd
TempMode
Silent=1
Overwrite=1


But I dont know what is command line is use to create the run.cmd file

Edited by dub, 16 September 2010 - 04:50 PM.


#4
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,970 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
Setup=software.exe /w
Setup=run.cmd
Setup= (You can have as many of these as you want)
TempMode
Silent=1
Overwrite=1

#5
dub

dub
  • Member
  • 5 posts
  • Joined 15-September 10
  • OS:none specified
  • Country: Country Flag
Thanks for reply Kelsenellenelvian

Do you know the script code for the run.cmd file to copy the specfic file in sfx archive to C:\Documents and Settings\%username%\Application Data folder?

Thanks all

Edited by dub, 16 September 2010 - 09:47 PM.


#6
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,970 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
XCOPY .\profile.xml %appdata%

#7
dub

dub
  • Member
  • 5 posts
  • Joined 15-September 10
  • OS:none specified
  • Country: Country Flag
Thanks Kelsenellenelvian, you're a genius

Its is possible to copy a folder + sub folder + 2 files

example
Profile folder / Username folder / profile.xml + Username.bin

Thanks again

#8
Kelsenellenelvian

Kelsenellenelvian

    WPI Guru

  • Developer
  • 8,970 posts
  • Joined 18-September 03
  • OS:Windows 7 x64
  • Country: Country Flag
XCOPY .\Folder\* %appdata% /s /i

http://ss64.com/nt/

Edited by Kelsenellenelvian, 17 September 2010 - 02:42 PM.


#9
dub

dub
  • Member
  • 5 posts
  • Joined 15-September 10
  • OS:none specified
  • Country: Country Flag
THANK YOU Kelsenellenelvian !

#10
Softkiller

Softkiller
  • Member
  • 5 posts
  • Joined 20-December 11
  • OS:Windows 7 x86
  • Country: Country Flag

XCOPY .\Folder\* %appdata% /s /i

 

 

after created batch file and prepared directory for transfer on local user appdata

 

invalid number of parameters

 



#11
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,914 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag

?

Not sure about this, but you MAY need to wrap %appdata% with quotes, e.g. "%appdata%".


Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image


#12
DosProbie

DosProbie

    MSFN Expert

  • MSFN Sponsor
  • 1,042 posts
  • Joined 16-October 12
  • OS:Windows 8.1 x64
  • Country: Country Flag

Donator

when using xcopy quotes is not always needed but is always a good practice to include them just in case of spaces in source path etc.



#13
submix8c

submix8c

    Inconceivable!

  • Patrons
  • 4,914 posts
  • Joined 14-September 05
  • OS:none specified
  • Country: Country Flag

Really?

C:\Documents and Settings\<username>>echo %appdata%
-Result is:
C:\Documents and Settings\<username>\Application Data

in Windows XP / Vista / Seven

That would apply to 2K and 2K3 (what I did it on) as well. It will be different for Vista/7 - the result will be

C:\Users\<username>\Appdata\Roaming

(performed on Win7 Home Premium).

 

IOW,  "xcopy" will NOT run with blanks in the name, hence wrapping in quotes. ;) P.S., you will need a backslash and whatever filenames\folders (however you do it) immediately following the VariableName ("%appdata\<somethinghere>%") within the quotes. S.O.P. :yes:


Edited by submix8c, 04 December 2013 - 05:45 PM.

Someday the tyrants will be unthroned... Jason "Jay" Chasteen; RIP, bro!

Posted Image





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users