/build/static/layout/Breadcrumb_cap_w.png

Script to copy to temp folder and recopy after installation

Hi All,

I need a script where it should look for 2 ini files in C:\windows, and move it to the temp folder. And after an application installs, it should copy those files back from temp to c:\abc

I can make this as 2 different scripts, one before install and after.

I do no have much scripting knowledge,

Please guide me. This is an ASAP project.

Thanks in advance.


2 Comments   [ + ] Show comments
  • Are you going to be running the scripts manually or with some tool? Will the files always be present in c:\windows or do you want to check for their presence first? What are the files names? - chucksteel 10 years ago
  • Hi Chuck, I will be running through HPCA, I want o check for the presence too, and then move to temp folder.
    The files are ini files
    DDMSCPIC.ini and STNOP.ini - shamu99 10 years ago

Answers (3)

Answer Summary:
Posted by: SMal.tmcc 10 years ago
Red Belt
2

you can do this as a batch file

you can use the if exist statement to check for the files also at the beginning if really needed.

http://stackoverflow.com/questions/3253520/if-exist-c-directory-goto-a-else-goto-b-problems-windows-xp-batch-files

but you can do it this way

start /wait md c:\installtemp

start /wait xcopy c:\windows\ddmscpic.ini c:\installtemp /q

start /wait xcopy c:\windows\stnop.ini c:\installtemp /q

start /wait misexec /i a.msi /qn or whatever type your install is with proper silent switches

start /wait xcopy c:\installtemp\*.* c:\windows /q /y

start /wait rd c:\installtemp /s /q

DDMSCPIC.ini#sthash.IJxvhmdD.dpuf

 

Posted by: shamu99 10 years ago
Fifth Degree Brown Belt
0

Thanks,

But When i use the script, and run the batch script through radia, it asks me the below

Does c:\installtemp specify a file name or directory name on the target <F=file,D=directory>?

 


Comments:
  • Try using mkdir instead of md or you may even have to do this way - start /wait "cmd /b md c:\installtemp". Something with the way it is passing the parameter.

    To tshoot you want to set echo on and put a pause after the md command to see what it passing to the command line. - SMal.tmcc 10 years ago
Posted by: shamu99 10 years ago
Fifth Degree Brown Belt
0

Thanks .. the script worked for me

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ