I'm trying to debug an .exe that i'd normally run with this command line : ./problem.exe a.txt but i'm not really sure how to provide a.txt . I see the tab Arguments when i open the executable and i did write a.txt in there but doesnt seem to work . What's the exactly format of arguments ? All comand line ? Command line between quotes ? Just a.txt ?
When you run the command
.shell -ci "!peb" findstr "Current"
at the initial breakpoint, you'll find that the working directory of an executable started by WinDbg is actually the WinDbg directory. Certainly, a.txt is not in that directory.
Make use of the "Start directory" box and enter the path where a.txt is located (without file name).
Related
Lets say I have a folder called xfile, inside of it we have runthis which is executable.
So, in order to execute that, I have to cd xfile and then ./runthis. and it will work just fine.
But, If I have a script call it run.sh and do this ./xfile/runthis, it will says run.sh: line xx: ./xfile/runthis: No such file or directory
So, how to make it happend without doing cd? It's been bugging me alot lately.
The leading dot in your command ./runthis means "relative to the current directory". But when you want to call it from outside the directory, remove the dot and provide the absolute path of your executable file xfile/runthis. The same is true when you want to call it from your run.sh
There must be a more effecient way to this, why can't I just type in the files name in the command line and expect the computer to find it? Right now I'm just paddling back and forward with the 'CD' and 'CD ..' commands.
You can use the following command which searches for the file in command prompt.
dir package.json /s
You can Use command find -path *content/docs/file.xml to find out the file.If it works please inform me the same.Thanks
The code I have at the moment is:
#!/bin/bash
cd "/Users/{User}/Documents/jarfiles/"
runnable_game=$(find . -type f -name 'game\..*\.jar')
echo $runnable_game
eval $runnable_game
in my Documents folder I have a folder jarfiles and within that folder there is only 1 jar file, although if possible only make it select the first file found.
The goal is to execute this file. for example: /Documents/jarfiles/game.1234.jar should be run.
for debug I put an echo in there, but the echo returned nothing, a blank line.
I have some programming skill, but I am not professional and in no way used to shell scripts or terminal command line magic. (I program in Java, C and such...)
Any idea to make a script that finds a file and runs it?
to clarify:
I don't know the filename in advance any .jar file to that format should be run, basically I download a file to that directory which is in that format
To execute a jar file you know is there but you don't know the exact name,
you can use a simple shell wildcard,
you don't need the find command:
java -jar game*.jar
If you want to execute only the first file found, then find can be indeed useful:
find . -name 'game*.jar' -exec java -jar {} \; -quit
Correct shell code to run 'game' + any string + 'jar'
#!/bin/bash
cd "/Users/{User}/Documents/jarfiles"
java -jar $(find . -name 'game.*jar')
game\..*\.jar escaping using \ seemed to not work
this will find files starting with game and ending with jar, not game. and .jar, which is not a problem (at the moment).
I want to run that Omnet++ project using command prompt. I am trying to execute the .exe file using the cmd prompt it is showing me the system error- "The program can't start because liboppcmdenvd.dll is missing from your computer. Try reinstalling the program to fix this problem".
I reinstalled the program but still it is showing the same error. So can anyone please tell me what is that .dll file and how I resolve this error? And also is there any way run Omnet++ from command prompt and write result to a file without opening the graphical simulation interface?
Thank you.
It is possible to run OMNeT++ simulation without Eclipse in Windows. Setting paths to OMNeT++ libraries as well as to MinGw binaries is most important.
I assume that:
you use OMNeT++ 4.6
OMNeT++ is installed in e:\omnetpp\omnetpp-4.6
your model is called wireless1 and is located in e:\omnetpp\omnetpp-4.6\samples\wireless1
your model depends on MiXiM 2.3
Mixim-2.3 is located in e:\omnetpp\samples\MiXiM and it is built
1.Append the following path to the Windows system PATH variable: e:\omnetpp\omnetpp-4.6\bin;e:\omnetpp\omnetpp-4.6\tools\win32\mingw32\bin;e:\omnetpp\samples\MiXiM\src
2.The list of directories with NED files in MiXiM has to be prepared. Do the following:
open mingwenv.cmd
in the mingw console type cd /e/omnetpp/omnetpp-4.6/samples/wireless1 then find ../MiXiM/ -name "*.ned" -printf '%h\n'| sort -u > list1.txt then tr '\n' ';' < list1.txt > list2.txt
3.In the e:\omnetpp\omnetpp-4.6\samples\wireless1 directory create a new text file with the following content:
#echo off
wireless1.exe -u Tkenv -l mixim -n [CONTENT OF LIST2.TXT] ..\simulations\omnetpp.ini
where after -n you have to paste the whole content of list2.txt (without the last ; and without [,]).
Then save this file as standalone.bat and just double-click on it to start simulation. Results of the simulation will be written to *.sca and *.vec files in simulations\results.
In order to run without GUI change -u Tkenv into -u Cmdenv.
I installed Strawberry Perl to run the rouge program in Windows. But when I want to run my program, I receive an error message that you can see on the image:
The system can't find the path specified.
My code is attempting to run "ROUGE-1.5.5.pl" but i think the system can't find this file. So I think maybe I don't initialize the path correctly?
I change my code to :
#!/usr/bin/perl
use Cwd;
$curdir=getcwd;
$ROUGE="..\ROUGE-1.5.5.pl";
chdir("sample-test");
$cmd="$ROUGE -e ..\data -c 95 -2 -1 -U -r 1000 -n 4 -w 1.2 -a DUC2002-ROUGE.in.26.spl.xml > ..\sample-output\output.out";
print $cmd,"\n";
system($cmd);
chdir($curdir);
and i receive this error:
Missing braces on \o{} at C:\runROUGE-test.pl line 7, near "$ROUGE" Execution of C:\runROUGE-test.pl aborted due to compilation errors.
As per the screen shot, you are attempting to run \ROUGE-1.5.5.pl where you probably want it without the spurious backslash (or with ..\ROUGE-1.5.5.pl if the parent directory is not on your PATH).
Similarly, you probably want the output in sample-output\output.out, or even just output.out, not \sample-output\output.out unless you specifically have a folder C:\sample-output for this purpose.
The backslash is significant; it is the absolute path to the root (of the current drive, on Windows). ..\ is the relative path to the parent folder.
Why are you writing a Perl script to run a Perl script, though? Either a simple batch file, or copy/pasting the command directly at the DOS prompt would seem like a less roundabout solution.
The problem is that when you are outputting the contents of the program to the file output.out in folder sample-output, the sample-output folder does not exist.
Command Prompt will not create the folders for you, only the files. Try creating a directory first called "sample-output" (In your drive root) such that the path resolves to something like C:\sample-output and run it again.
If the same problem results, try using an absolute path such as C:\sample-output\output.out instead.