I am trying to start a dxl script with command line. But i am getting lots of warnings and errors.
When I try this script on doors gui , it works fine but when i try on this command line without gui, it doesn't.
Here is the image of warnings :
Here is the commandline script :
"%ProgramFiles%\IBM\Rational\DOORS\9.3\bin\doors.exe" -d 36677#bie -u "xxx yyy" -P don -b "d:\workset\mc\addins\Devel\exporterRTF.dxl"
Why it doesn't work with commandline ? Any help, idea etc is appreciated.
EDIT :
this is a link which i try to run : myprogram.dxl
this is a link which is imported in my running script include in myprogram.dxl
this is a link which is secondly imported in my running script include in myprogram.dxl
There are other settings you need to run in Batch mode (pulled from the DOORS help):
Runs Rational DOORS in batch mode. Rational DOORS starts without the GUI (it suppresses the login screen and the database explorer), runs the specified DXL program, and then stops.
In batch mode you normally need other switches like -user, -password and -project to log in and specify the current project.
The parameter of the -batch switch specifies the file that contains the DXL program that you want to run in batch mode.
You probably need a current project specified. Also you may need to add a command at the end of your script to exit DOORS if you don't want the session to stay open.
The errors that you list seem like regular DXL errors, so if you need more assistance than this, you will need to post some of the code.
EDIT:
If you put all of the files into one does it run? Another option may be to include the Addins path on your command line. I believe the issue is that the batch mode is not recognizing the included files as part of the same scope.
Related
I have a .sh script file that I'm modifying which runs an .EXE file that opens the Windows command line prompt automatically.
This .exe asks the user for an input (name of the file in the folder workspace that it will read)
I want to automate this step in my shell script so my user doesn't have to interact with this, and run the commands automatically
I read a bit about the expect command but I think that is for Linux only.
Can someone help me, I'm pretty new to Shell scripting and I couldn't find any useful information elsewhere.
I'm assuming that your executable accepts command-line arguments. So, here we go.
You can use the "start" command in Windows Shell. For example:
start C:\path\to\program.exe -argument
If you want to make the script wait until the .exe file finishes running before continuing, you can use the "/wait" command:
start /wait C:\path\to\program.exe -argument
IF all of that doesn't work, please try:
start myprogram.exe /command1 /command2 /command3
Hope it helps,
The application moves files from one directory to another, runs an exe, and then moves files from one directory to another.
When I run the application manually it works as expected.
However, when trying to run it as a scheduled task I get the following error: 3762504530
I did some researching and it appears it may have to do with the application trying to run interactively even when there is no user actually logged in.
I have tried to suppress outputs but that didn't seem to have any effect.
Without seeing the code i guess u use console output or similar...
If so change write-host to write-output or alias "echo" pipe it to log file if u want...
Also be sure that your script run "non interactive" (no prompts etc.)
Unchecking compile a graphic windows program (parameter -noConsole), remedied the error.
I have another bat file that I'm running, and once in the command prompt that bat file creates, I want to run another command in that window.
Here's what I have so far:
call C:\Batch\MyBatFile.bat (this creates the new command prompt that I want to use)
C:\Program\MyProgram.exe
However, the second line is being run in the original window, instead of the new command prompt. I tried using start C:\Program\MyProgram.exe, but that just ran in a 3rd new window instead.
If it's relevant, the first line is just setting a few environment variables that I need access to and MyProgram is a visual studio 2010 project. Technically, I might be able to modify that bat to run the command, but I'd rather avoid that solution as that bat file isn't owned by me (and thus whenever it's updated I'd have to update mine as well).
Thanks in advance.
You could try to inject your program.exe into cmd created by batfile.bat by redirecting it's input stream and then sending it a command, eg. echo C:\Program\MyProgram.exe | C:\Batch\MyBatFile.bat. This assumes that batch really just sets bunch of variables and does not use commands which reset/consume input stream.
Please note that if redirected/piped this way new command window will not stay open It will maybe :-) just execute your command and then close/exit.
Create a CMD script to run both of the commands that you have shown in the question. Maybe call it RunMyProgram.cmd. The contents are just the two lines that you have:
REM Source the environment variables.
REM Any new command prompt window that is opened can be ignored
CALL C:\Batch\MyBatFile.bat
C:\Program\MyProgram.exe
If what you have stated in the comments to your question is accurate regarding MyBatFile.bat setting up the environment variables and then starting a new window, then you should be able to make use of those environment variables after MyBatFile.bat exits.
If running RunMyProgram.cmd from a command prompt still has MyProgram.exe giving the error when the environment variable is not set, or if MyProgram.exe doesn't even start to run until you close the new window that popped up, then we need to see the exact commands that MyBatFile.bat is executing.
I am working on Windows 7 (logged in as session no.1), my Jenkins CI is running as windows service in session 0.
My problem is.. I want to open an Excel file through Jenkins CI in session 0, but want to display its GUI on session 1.
I know that session 0 is isolated in Windows 7, but is it possible to run a process in session 0 and then output in another session? please help.
Edit:
Took a little trial and error, but this is what finally worked for me (Windows 7 64-bit).
Download PsTools from Microsoft site
We only need psexec.exe, but you can extract everything. Extract to some location accessible by Jenkins, preferably without spaces in the path.
Open elevated command prompt: type cmd into Start's quicksearch, right click cmd.exe, select Run as Administrator.
Type C:\path\to\psexec.exe -accepteula and press enter.
Type C:\path\to\psexec.exe -i 1 cmd and press enter. (If you see a command prompt appear, all is good, close it now)
In Job configuration, configure Execute Windows Batch command step
Write the following:
C:\path\to\psexec.exe -accepteula && C:\path\to\psexec.exe -i 1 cmd /c start C:\PROGRA~2\MICROSO~1\path\to\excel.exe
Where:
C:\path\to is your full path to psexec.exe, unless it is in your %path%
-i 1 is the session ID that you want to launch in.
C:\PROGRA~2\MICROSO~1\path\to is your full path to excel.exe without spaces. Since most Office installations are going to be under paths with spaces, like "Program Files (x86), you have to figure out the short path, or place it somewhere without spaces.
Having excel.exe under %path% and working from regular command line was not enough.
A little explanation for those that care:
psexec needs to install a services first. For that, it needs to be run from elevated command prompt for the first time. This is a one-time installation step.
To make psexec work, you need to accept the EULA prompt. This is done per session/user. So even if you run psexec -accepteula in your command prompt, it doesn't help when Jenkins service (running as Local System in session 0) tries to use it. Therefore, you have to place that into the Jenkins job, along with the command. Technically, it only needs to be there once, and can be removed afterwards, but it definitely doesn't hurt to keep it there.
I've used cmd /k and running this command from my local cmd prompt to debug. This is what made me realize I couldn't find a way to escape the spaces (tried various quoting), so had to resort to short file names. Note that short file names are not required, this is just to escape spaces.
no its not-
plus any UI interactions requires you to run Jenkins as Java web start rather than a service or you can not interact with UI elements.
I'd like to execute a batch file when I run the solution which will prepare the environment that I'm deploying to. I want this to run first thing when I hit F5 before anything else happens. Is this possible? If so, how?
In the project's property pages, under Debugging tab, set the proper value for Command option. Default value is $(TargetPath), which will run the output executable. Just specify your batch file there.
You will have to run the executable on your own in this case. I suggest passing $(TargetPath) as a parameter to your batch script and then executing the parameter.