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.

Answer Summary:
Cancel
2 Comments   [ + ] Show Comments

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?
  • 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
Please log in to comment

Community Chosen Answer

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

 

Answered 12/05/2013 by: SMal.tmcc
Red Belt

Please log in to comment

Answers

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

 

Answered 12/10/2013 by: shamu99
Fifth Degree Brown Belt

  • 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.
Please log in to comment
0

Thanks .. the script worked for me

Answered 12/17/2013 by: shamu99
Fifth Degree Brown Belt

Please log in to comment
Answer this question or Comment on this question for clarity