6

I was trying to deploy my project with IExpress. I have the following scenario. I want to extract some files to a location preferably c:\program files\. Then after it copies all the files i want it to run a .cmd file (which is a script). the script is also added in the project itself and it would refer to a file which is copied by IExpress. Now how can access the path on which the file was extracted. So that i can access it in my script.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Anirudh Goel
  • 4,571
  • 19
  • 79
  • 109

2 Answers2

4

If the script is in the project itself, thus being extracted in the same directory when you send your files to, it should start in the same directory.

Test it easy, make a cmd like this:

cmdsetup.cmd:

@echo Source path: %~dp0 >> %temp%\%~n0.log

Put this in your package and when it's done, go check the %temp% directory, locate the cmdsetup.log file and look in it. This should be the path where your files are.
If so, go from there. If I got this wrong, come back and comment, also amend your question to make it clearer.

I hope this helps.

P.s.: Voted for the question as I don't see why the negative vote was given.

Jay
  • 1,635
  • 16
  • 14
2

The answer is use this format:

start /wait .\hello.cmd

I did this with the following two files. One key thing is that the file I was calling had to be in 8.3 format. In otherwords it failed to find hello.cmd the first time because i called it hello.world.cmd.

First file (start.cmd)

@echo off
cls
echo this is start.cmd
pause
dir
pause
echo going to hello world
start /wait .\hello.cmd
echo back in start.cmd
pause

Second file (hello.cmd)

@echo off
echo HELLO WORLD!
pause
exit

Directions

Use IEXPRESS to create a package that contains both files above. Have it launch START.CMD.

Tom van der Woerdt
  • 29,532
  • 7
  • 72
  • 105
Craig
  • 21
  • 1