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.
Answers (3)
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
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 11 years ago
The files are ini files
DDMSCPIC.ini and STNOP.ini - shamu99 11 years ago