My command prompt won't run exe files without their extensions.
For example, help won't work, but help.exe works fine. Does anyone know what the culprit might be?
Related
I hope this is an easy fix, but I couldn't find any documentation or other posts on the matter. I'm trying to write a script (cmd or pwsh) that will launch vscode with my preferences on a portable install.
When trying to execute vscode's code.exe with any arguments, it ignores them and just launches the program as if I had typed nothing else. I'm following this doc in my testing. Using alias switches doesn't work, either. The only argument that does seem to process is if I include a path.
code.exe --help
code.exe --version
Additionally, after launching code.exe, the console kind of hangs, then vscode status messages are sent to that console (even without use of the --wait switch). If I close the console, vscode shuts down. Is there a way to work around this?
When using Code via shell (cmd or pwsh), it does not use Code.exe, but the script/batch files located under Bin folder (code.cmd). These are the applications which really recognizes the command line switches.
This is not entirely clear in the Command Line Documentation page, but looking closer at the Note you will see that it does say the Program Files\Microsoft VS Code\bin folder.
I have absolutely no idea on how to run cmd scripts using notepad. I want to be able to automatically run a cmd script as my user logs on to my computer. I researched everywhere, but could not find anything that could help. All i really want is some stater code to work off of so that I can input my own scripts. Thanks.
When attempting runCommand("cd", "..") from inside a js.jar console an IOException is thrown.
I believe it's because in the command prompt the CD command is actually built into the console and not a separate .exe file. The runCommand("notepad") works fine, and that .exe can be found on the classpath in the usual location.
Is there a work around for this?
I was thinking that changing the directory through java instead of through the command prompt it might solve this problem, but I don't recall how to do that from java, but I plan on trying to figure that out.
To sum up: Is there a way to run "cd" from within a Rhino JS console on windows?
Thanks,
L-
Multiple issues to solve here; it depends what you are trying to do.
runCommand actually runs executable programs. cd is not an executable on Windows; it is a command in the command shell. So you would need to execute something more like this:
runCommand("cmd","/c","cd <target-directory>")
However, the underlying Java runtime does not allow you to actually change the working directory anyway. See this StackOverflow discussion. So shelling out cd just changes the directory for the subprocess (the process running cd), which is probably not what you want.
Folks, I'm using git tools such as git bisect run which need to call a command to build and test my project. My command to do is nant which is a windows program. Or a build.cmd script which calls nant.
It's easy to get the bash to call the nant build to run.
But the hard part is how to get the standard output written to a file?
I even installed the Windows PowerShell to try running a command from bash.
Again, it works but the standard output fill says "permission denied" when
I try to read it while the build is going on.
Update:
When running nant, the entire path is used. It is installed and runs fine. The problem is how to get the standard output when running from bash.
If running nant from the windows prompt with "> build.out" at the end of the line, you will get the standard out. But the same never works under bash. It just says build.out is locked, permissions denied.
Update:
Using tee as suggested below also doesn't solve the problem. In that case the file still report "access is denied" with any attempts to read it while the build runs. But also, the tee program never writes anything to standard output.
(If I am understanding your question correctly...)
You can probably use the 'tee' command to split the output to both a file and stdout. The line echo I am building something | tee build.out will both print the output on the console and save it to the file named "build.out".
The tee command is usually available in Cygwin, and also apparently in the Bash shell installed by msysgit (where I just tested it). Here's a good reference page for more details.
Okay, finally resolved this. It turns out the the nant build script was using git feature to erase all ignored files to cleanup. That was deleting the build.out file can causing these strange issues. Now, the process writes the build.out file to a parent directory so that it won't get deleted and now everything works smoothly as expected.
When I type 'http://www.google.com at the Windows Run: prompt it launches my default browser.
But when I do it at the CMD or Commnad prompt it does not. I assume that there is some form of RunDLL command being issued but I can't find out what.
Does anyone have any insight?
I think it's the equivalent of using START.
If you try
START http://www.google.com
from the command line (or a batch file), it should work fine.
What Jon said appears to be correct. I tested it with mailto:someone#somewhere.com. Interestingly if you wish to make run work like the default behaviour of cmd, you can do the following:
Start -> Run -> cmd /c http://www.google.com. Not sure why anyone would ever need to do that though!