FAQ Database Discussion Community

How to run multiple JAR files at differnt locations from a command prompt

I have 2 jar files at different locations. I need to run both these jar files from a single command prompt window. I referred to many SO links and google links and created this batch job. START SET JPOS_DIR=D:\Installable\JPOS\Iso8583jPOSJavaAgent-0.0.11 cd /D %JPOS_DIR% "C:\Program Files\Java\jdk1.7.0_75\bin\java" -cp Iso8583jPOSJavaAgent-0.0.11.jar com.hp.sv.iso8583.jpos.ISOForwarderMain START SET JPOS_DIR=D:\Installable\JPOS_Instance-2\Iso8583jPOSJavaAgent-0.0.11...

Echo command cuts new lines

I'm trying this command in my prompt to get all results into one file: $ echo $(apt-cache search nano) > search But, they are writing in a one line: $ cat search alpine-pico - Simple text editor from Alpine, a text-based email client libboost-chrono-dev - C++ representation of time...

Trying to learn batch script, what does this do: /letter?

Here's the batch file: @echo off xcopy c:\testsource c:\testbackup /m /e /y So I know that "xcopy c:\testsource c:\testbackup" copies the files in the testsource directory and pastes them in the testbackup directory, but what does the "/m /e /y" do? Can you explain what each individual part of this...

error: package org.jsoup.Jsoup does not exist while compiling the class using command prompt

While compiling a java class in which I had imported packages such as org.jsoup.Jsoup, the following error was retrieved: package org.jsoup does not exist. I don't know how to add the classpath for jsoup-1.8.1.jar file....

Can I get correct DLL module list for tasklist /m when checking 32 bit program on a 64bit machine?

Command tasklist on windows has really useful feature: it can list all dll modules for a process, or all processes. Command bellow will list all DLL files used by explorer.exe: tasklist /fi "ImageName eq explorer.exe" /m Looks like this (shortened, translated to english): Process name PID Modules ========================= ======== ============================================...

How to correctly quote a command with parameters in a Windows batch file

I am attempting to open multiple PDF files in multiple tabs in multiple windows using PDF X-Change Viewer, which has command line options. All PDF files listed in the same line open within the same window. To allow the script to proceed without waiting for the windows created on each...

Del command in command prompt

I want to, for example, delete a file in AppData/Roaming/MyFolder/myfile.txt. I use command prompt and typed this: del %userprofile%/AppData/Roaming/MyFolder/myfile.txt But then the command prompt said: Parameter format not correct - "ppData" Then I think again and used %appdata% and typed:del %appdata%/MyFolder/myfile.txt But the command prompt said: Invalid switch - "MyFolder"...

Delayed expansion of command line variables

i want to do this in one command: set myvar="hello" && echo %myvar% and get "hello" on the screen. but i get %myvar% instead. How can this expansion be done immediately so i get "hello"? Edit: how does it look like when using angle brackets: set "var=<hello>"& echo %^var% ...

CLion cout opens command prompt window instead of using CLion's terminal

When I do cout << "test" in clion and then build it instead of writing it to IDE's terminal like IntelliJ, PHPStorm or any other of the Idea IDEs it opens a new command prompt window, writes it to that and them immediately closes the command prompt window so I...

Batch file runs with “not recognized…command”, how to fix this?

I have a batch file which when executed sets PATHs, prompts user for input and loads a script via Python. The python script creates a grid with the size of each cell determined by the user input variable (cellsize). The following is from my .bat file: @echo off rem Root...

How to make this Java JApplet file work with Command Prompt?

In my textbook, I'm learning to create a simple HappyFace.java program, which outputs a smiley face using JApplet and Graphics methods. import javax.swing.JApplet; // swing library package import java.awt.Graphics; //Graphics from AWT library //inheritance used to create HappyFace based on existing class JApplet public class HappyFace extends JApplet //class definition...

What are the consequences, if any, of multiple backslashes in Windows paths?

In my programs I frequently have file names and/or paths that are configured in my app.config file. This will usually be something like: <add key="LogFileDirectory" value="C:\Logs" /> <add key="SaveLogFileTo" value="MyLogFile.txt" /> In my actual application code, I'll frequently concatenate these together with code similar to this: var logFile = ConfigurationManager.AppSettings["LogFileDirectory"]...

Can someone explain how Python's subprocess module communicates with Command Prompt?

I am very new to programming and have been pouring over this site and others to better understand how I can write a script in Python (version 3.4.1) that does what I already know how to do in Command Prompt (version 6.3.9600). In Command Prompt I can very easily type...

npm install error not installing BrowserSync package

Trying to install BrowserSync I've followed the steps to install the package through the command line, installed node.js and then I went on to install npm through the command line. Now when I try to install browser-sync with the following line npm install -g browser-sync you will see it is...

Using CLIP command within a Batch File

I am trying to write a batch file to do the following: Copy a given file (drag and drop or through "send to" option) to a predefined network drive Build a file path string Copy the file path to the clipboard Here is what I have so far: @ECHO OFF...

how to schedule a task for every 5 minutes in windows command prompt?

Now i scheduling the bat files using task scheduler.But i want to do this using windows command prompt using schtasks command.That batch file should run for every five minutes and it should repeat the same thing in every day.

how to change prompt size of textinput in flex?

I have created a spark text input component and I prompt a text in the text input using prompt property. But the font size of prompt is very small. How to change the font size of prompt....?

How can I launch a download from the internet using command prompt?

I want create a program than launch a download from the internet using a command of command-prompt. Do you know this command ?

Git Commands for Collaboration

I'm learning basics of Git, but I can't grasp one concept. I went through major tutorials on YouTube, Github, Attlasian, Gitguys and Git-SCM. Unfortunately those tutorials are written by programmers who aren't teachers. Here is the thing: I want to contribute to an existing repo (unit testing). But I'm only...

Alert on operation completion in windows cmd

Using windows cmd I have to put large programs on compilation which take large amount of time. Everytime to know whether operation is complete or not I have to check cmd again and again. I want to know whether there is way by which I can make changes to cmd...

Can't run MySQL from command prompt

I downloaded MySQL 5.6.25 for Windowsx64 and I tried to run the command mysql -uroot -p to start using MySQL but it says 'mysql' is not recognized as an internal or external command, operable program or batch file. Do I need to move MySQL to some other place? It is...

How to run another file using command prompt and continue with the rest of steps without waiting for the file to be closed

I came across a strange scenario where it works intermittently. Requirement: Need to back date the system date before running a file and once the file is ran the system date should be reverted to the current date. I have written a code which works for one of the file...

Best way to check if a opened file needs to be resolved in perforce (command line)

I searched all over the net, but couldn't seem to find an answer. What is the best way to find if an opened file needs to be resolved before submitting programmatically (using p4 command line tool). Note: I need to find it before submitting (I know perforce will throw an...

Getting the exit code of an application started with the “cmd” and “start” commands

I have a console application. Interaction with this application is done via TCP/IP. I also have a test framework for it, which is basically a collection of BATCH scripts (...not my fault). What this test framework does for each test is basically this: start /min "myapplication.exe" and wait until verification...

HTML syntax highlighting in VIM on Windows 7

I've set syntax highlighting on when running VIM from the command prompt. I do this by putting in the line syntax on in .vimrc file. I have also in my .vimrc the setting set background=light. And my command prompt background color is white and text color is black. When I...

DLL missing error when EXE run from command line [VS2010]

So I built an SSH-connect-test console application using libssh library, and is dependent on ssh.dll. The application works perfectly fine when run from inside VS2010, but gives "ssh.dll missing from your computer. Reinstall the program" error when the same EXE is run from the command prompt. Any inputs as to...

Windows Command Prompt :echo a variable without double quotes

How can i echo a variable in Windows Command Prompt without the double quotes? I want to use a One-Liner in terminal and no batch script. something like : set myvar="somevalue" and now i want to echo %myvar% and get somevalue instead of "somevalue". Is this possible at all?...

Batch File for zipping Current day XML files

I have to do a task where in //Traning/Biz having some xml file with prefix naming Current day, like 201504140157034_{hgds}.xml. I need to create a Batch script which can create a zip file with current date name on same network folder and zip all current day files to that. I...

How do I install homebrew on mac?

I tried the command ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/Library/... /usr/local/share/man/man1/brew.1 ==> The following directories will be made group writable: /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig ==> The following directories will have their group set to admin: /usr/local/include /usr/local/lib /usr/local/lib/pkgconfig but I have no idea what that...

No Instance(s) Found when Remotely getting a list of installed programs

So every time i run my batch file, ill type in the computers name, then type what program i am looking for. I have added the "name like '(word)%'" part so it doesnt need an exact match to find a program. Here is my code: @echo off set /p name="Enter...

Openfiles query to see open files

How can I call the Openfiles.exe (which is on the server 2008 file server) remotely from a computer to see which files are open by the users? I also need to have it login as the domain admin user in the parameters.

Calling HTML Help from command prompt with keyword

I have to call html help - chm files, that is - from a command prompt. i know how to call the file: hh "mk:@MSITStore:C:\temp\damatomodule.chm" I even know how to go to a specific page hh "mk:@MSITStore:C:\temp\damatomodule.chm::/page/topic.htm" What I have to do is go to a specific keyword without knowing...

How to read a text file from SD card in Android device through command prompt?

There is a folder called "D_Permision" SD Card and there is a text file called "permission.txt" in it. I want to read this text file through command prompt and display its content in the command prompt(Not in a separate file) When I use adb pull permission.txt /sdcard/D_Permission it gives following...

Trying to run a java file from command propt, getting errors [duplicate]

This question already has an answer here: How to fix: Unsupported major.minor version 51.0 error? 30 answers I am trying to run a java class file from the command prompt and keep getting this error. Exception in thread “main” java.lang.UnsupportedClassVersionError: Bad version Number in .class file at java.lang.ClassLoader.defineClass1(Native Method>...

How do you search for file and replace whats missing?

I feel lost... Do you use the "find" command or "if not exist" commmand? Anyone feeling like helping? Here is my situation: Writing a batchfile to aid users in an install of new application software. Not all users have the application so for licensing I need to only install on...

Java “Loop” Program?

It's been a while since I've done some Java coding but here is a simple program, I did to calculate markup for my retail store. How would I be able to make the program loop until I close it myself? Right now, I run this program in my terminal/command prompt...

CMD : Merge Files Echo date and file name to merged file

I have used the below code to merge .cpp files in a directory.This code was a result of question asked in super user but there are no replies since my question was edited.So please don't mark this question as duplicate . @echo off cd C:\test echo ^<html^>^<head^>^<style^> pre {page-break-after: always;}...

Get a list of files present in a folder

I want the names of the files present in a folder . Is there any command in command prompt or any other way that can list all the file name(only file name and its extension) that are present in a particular folder?

Application logs on the command prompt from where application is being launched

I have an MFC application and launching its .exe from command prompt. What I want to achieve is that I want to show any logs from this launched application on the same command prompt. I have written this code: AttachConsole(ATTACH_PARENT_PROCESS); WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), errorMessage, ((string)errorMessage).length(), NULL, NULL); FreeConsole(); But this code writes...

Retrieving password from windows Credential Manager using CMD

I am trying to add and retrieve credentials from Windows Credential Manager using Command Prompt. To add a new credential I have the command like below and it works perfectly: cmdkey /add:testTarget /user:testUser /pass:testPassword However when I try to retrieve the credentials,which I have added earlier (testTraget) using CMD,I am...

How to update %time% variable in Batch Script

I have a batch script for backing up databases. I echo the %time% that script starts and then the %time% it ends to a log file. Even though the script takes 5 minutes to backup our databases the end time is identical to the start time. @echo off :: Credentials...

Jenkins Cannot import the following key file

I am able to build my application on Visual Studio without any problem. I am trying Jenkins out on the same machine. When I try to build my application from my git remote repository (It contains the .pfx file in the SVC) I get the error error MSB3325: Cannot import...

Environment variable only works in windows command prompt when i run it “start in %HOMEDRIVE%%HOMEPATH%” [closed]

I am trying to add the Sublime Text directory to environment variable PATH so I can start Sublime from cmd in Windows 7 easily. But, it is not working when I start cmd without doing this... Opening this shortcut makes all Sublime available in command line... However if I start...

How to write a batch file to open applications and close them if they are already open

I have already read how to write a .bat file in Windows 7 to open programs but what i want to do now is to have that same .bat to close them if they are already open. Let's say i run the batch file to open these applications at once...

phantomjs command line never works

I'm trying to run a command line in the phantomjs prompt (to create a PDF screenshot of a website) So I launched phantomjs.exe and after the phantomjs> I typed : phantomjs rasterize.js http://www.google.com test1.pdf Whatever I type, I get a Expected an identifier but found 'rasterize' instead phantomjs://repl-input:1 in global...

Create text file using echo in command prompt

I'm creating a hello_world.txt in the desktop using echo in command prompt and this is my input. echo hello world > C:\Users\user\Desktop\hello_world.txt The first code works, then I try %userprofile% if example, I want to give it to another user. echo hello world > C:\Users\%userprofile%\Desktop\hello_world.txt Doesn't work. Any simple echo...

Can python file be executed in Command Prompt regardless the drive where you installed Python program?

if I installed Python program in my E drive not C drive, is it the necessary that I must execute python files in the same drive that I installed python program in Command Prompt? for example, I installed Python Program in my E drive. I can only be allowed to...

Access Visual Studio Developer Command Prompt from regular Command Prompt

This related question shows how to build and run a Visual Studio solution from Visual Studio Developer Command Prompt. My question is, is it possible to build and run a Visual Studio solution directly from the regular Windows Command Prompt (cmd.exe)?

How to use variables in terminal prompt (bash) to modify files' names?

I'd like to run a command like this: $ valgrind --leak-check=full ./program < speed-01.in I've got a few tests like this ending with different suffix like -02, -03 and so on. Instead of writting a bash script I wanted to run these tests one by one while chaning only the...

set the OpenSSL_HOME variable

I am trying to configuring HTTPS based on this tutorial: Configuring HTTPS for your Elastic Beanstalk Environment I am stuck at the following section: To set the OpenSSL_HOME variable Enter the path to the OpenSSL installation: c:\ set OpenSSL_HOME=path_to_your_OpenSSL_installation My openSSL is installed in c:\OpenSSL, so would I write set...

Invalidate match in batch file for loop

I have the following directory structure: >C >SomeFile >.IgnoreMe >VitalSystemInfo.eiafj >DontTouchThis.ei3rw3j >Picture.jpg >Pandas.gif >Code.cpp >AnotherDirectory >MoreStuff.bacon and I have a loop to go through it for /R %f in (C:\SomeFile) do echo %f How can I exclude .IgnoreMe?...

zsh inserts extra spaces when performing searches and completion

I have written a small program that emits a command line prompt with some Git info. I use ANSI escape sequences to color it, and it looks something like this: However, whenever I do tab completion or a search, zsh inserts several spaces after the prompt: It seems to be...

command line not working when run from vba

I'm trying to unzip a file via my VBA code. I'm using 7z command line to unzip the file. However the command works when run from normal command prompt but the same command is not working when run via VBA code. Command: "C:\Program Files\7-Zip\7z.exe" x "C:\Users\Public\AppData\Local\Temp\Sample.zip" For further understanding, I'm...

Perform an svn commit in a remote directory

Is it possible to svn commit (in Windows) to somewhere other than the working directory? C:\Users\someuser>cd "E:\SVN_Releases\DEV" && svn commit -m 'This is a test.' svn: E155007: 'C:\Users\someuser\is' is not a working copy I have also tried (with variations): C:\Users\someuser>svn commit "E:\SVN_Releases\DEV" -m 'This is a test.' svn: E155007: 'C:\Users\someuser\is'...

Split the cmd prompt into two parts

I've been studying Java for about 7 months now and I've recently started with C++. I'm currently making a server (no gui, just cmd) which will handle multiple connections at the same time. And I was wondering if it is possible to split the CMD into two parts, so I...

Set Java path in command line for only one directory

I am running a program that utilizes Scala 2.10 for work and is not compatible with Java 8, only Java 7. In a Windows 7 command line, how can I set the java path to use Java 7 ONLY for that directory?

Expanding variables in a Windows batch file

I run the following command in a Windows batch file: start "" "C:\PDF Viewer\PDFXCview.exe" /A "page=1&zoom=33.3" "G:\my pdfs\file 1.pdf" /A "page=4&zoom=55.5" "G:\my pdfs\file 2.pdf" The works perfectly fine and opens both PDF files using their respective parameters. However, to make the process cleaner, I would like to start using variables...

how to prevent this infinite loop in powershell?

While referring to this tutorial on command line after executing the following commands in the PowerShell, it goes in a infinite loop. echo "I am a new file." > ex15.txt cat ex15.txt > another.txt cat *.txt > bigfile.txt After firing the last command the execution never ends.It goes in an...

merge content of 2 text files into a third text file - line by line

I am working on a trivia script in php and I got a problem that can't get past it. I have two txt files, one with questions and other with answers. The questions file looks like this: "How many arms a person has" => "How many legs a person has"...

Using Command Prompt in Visual Basic

I am trying to create an application in visual basic to open up a command prompt. I then want to type the word "Message" into the command prompt and have my application recognize the word "Message" and then run my application. Any help leading me into the right direction would...

Export mysql to a specific path via command prompt

I want to export my database to a specific path using command prompt, say, in D:\My Folder\Databases\mydatabase.sql. Is it possible ? If yes, can anyone tell me how ? Thank you so much for all of your help.

Compiling and running using external jar files

I am able to compile the program SendEmail.java, but I can't figure out why isn't it running. Here is the program: C:\6sem>javac -cp "C:\Program Files (x86)\Java\jre7\javamail-1.4.7\mail.jar;C:\Program Files (x86)\Java\jre7\javamail-1.4.7\activation.jar" SendEmail.java C:\6sem>java -cp "C:\Program Files (x86)\Java\jre7\javamail-1.4.7\mail.jar;C:\Program Files (x86)\Java\jre7\javamail-1.4.7\activation.jar" SendEmail Error: Could not find or load main class SendEmail Kindly help on how...

Cannot enter drive D via command prompt [closed]

I cannot enter my other disk partition using command prompt, it says "The device is not ready" every time i tried to access it. I can enter drive C but, not D. I have granted all privileges of disk D upon users, authenticated users, administrator and system. I also ran...

Batch scripting return most recent folder name with string match in text file

I created a little batch script that looks through all the folders with a sequential name given a root folder and returns the latest created: @echo off FOR /F "delims=" %%i IN ('dir C:\RootFolder\FolderName_* /b /ad-h /t:c /o-d') DO ( SET a=%%i GOTO :found ) echo No folder found goto...

How do I make a .cmd file that runs multiple rows on a single line?

Editing this for clarity. Code below for what I currently have in my .cmd file: "C:\Program Files (x86)\Steam\steamapps\common\Starbound - Unstable\win32\asset_unpacker.exe" ^ "C:\Program Files (x86)\Steam\steamapps\common\Starbound - Unstable\assets\packed.pak" ^ //This caret is interpreted as an argument instead of as a line continuation command. "C:\Users\Engineering\Documents\Design Projects\Starbound Unpacked" cmd \k Code below is what...

ansible ssh prompt known_hosts issue

I'm running Ansible playbook and it works fine on one machine. On a new machine when I try for the first time, I get the following error. 17:04:34 PLAY [appservers] ************************************************************* 17:04:34 17:04:34 GATHERING FACTS *************************************************************** 17:04:34 fatal: [server02.cit.product-ref.dev] => {'msg': "FAILED: (22, 'Invalid argument')", 'failed': True} 17:04:34 fatal: [server01.cit.product-ref.dev]...