#1
|
|||
|
|||
need help passing params to DOS cmd
I have a step that runs a dos cmd in it I have
%DOSCMD% "C:\My Projects\Sykes Newton\Enterprise\Version 1.0\ConfigManger\ConfigUpdate.exe" "/ configuration/appSettings/add[@key='DatasourceConnection']/@value" "initial catalog=PG_Newton;data source=SQL1;u ser=USER1;Password=USERPWD1;Persist Security Info=False;" "C:\My Projects\Sykes Newton\Enterprise\Version 1.0\Set up\Source\Server\Web\RemotingServices\Web.config" I get this error Building project step 'Remoting Services - Change the DB Name'... Error expanding macros in property command: C:\WINDOWS\system32\cmd.exe /C "C:\My Projects\Sykes Newton\Enterprise\Version 1.0\ConfigManger\ConfigUpdate.exe" "/ configuration/appSettings/add<Error at Line 1, Column 5 (Syntax error) Code: key='DatasourceConnection'> Build ended. but I can run the exact command in the dos window......any ideas ?? |
#2
|
|||
|
|||
Within step fields, you need to double up bracket chars to insert a literal bracket char (single brackets denote script code to be evaluated):
... [[@key='DatasourceConnection']] ... Hold the Shift key down when mousing over a field to see the fully expanded value (with all macros expanded and script evaluated). See 'script expressions' in the help index for more details. |
#3
|
|||
|
|||
thanks that got me furthere in the process I think ...now I get this error
'C:\My' is not recognized as an internal or external command, operable program or batch file. but i have double quotes around the "C:\My projects....." not sure why is complaining |
#4
|
|||
|
|||
Since you're not using anything that requires running under cmd.exe (redirection, an internal command, etc.) you can just drop the %DOSCMD% prefix from the command.
|
#5
|
|||
|
|||
still having issues I took out the %doscmd% and now I have just this
"C:\My Projects\Sykes Newton\Enterprise\Version 1.0\ConfigManger\ConfigUpdate.exe" "/configuration/appSettings/add[[@key='DatasourceConnection']]/@value" "initial catalog=PG_Newton;data source=PHMNL2SQL0033;user=PGNewton;Password=P6N3w0 u48 ?n;Persist Security Info=False;" "C:\My Projects\Sykes Newton\Enterprise\Version 1.0\Setup\Source\Server\Web\RemotingServices\Web.c onfig" if I take this into cmd prompt and take away the extra "[" and "]" it runs fine.....not sure what I'm doing wrong in the first statement any ideas ......thanks FOR ALL THE HELP SO FAR..... |
#6
|
|||
|
|||
What issues are you having? Have you tried updating the config file within VBP via script instead as shown here: http://www.kinook.com/Forum/showthread.php?threadid=427
|
#7
|
|||
|
|||
I have not tried the script method just yet.....I have created a exe (Configupdate.exe) that takes a xpath to change.....it works within the command prompt......but once I place it in visual build I get this error
The filename, directory name, or volume label syntax is incorrect. Build successfully completed. |
#8
|
|||
|
|||
Not sure. Run Program does essentially the same thing that cmd.exe to run a command (call CreateProcess). It sounds like the error is coming from your exe. Try copying your exe to the root of the drive and invoke it without any parameters (i.e., use a Run Program command of C:\ConfigUpdate.exe), then add your parameters one at a time to determine what it's complaining about.
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|