Newest cmd Questions

Q&A for professional and enthusiast programmers

'$' is not recognized as an internal or external command, operable program or batch file [on hold]

I'm trying to run Clarifai API Python Client on Windows 7 64-bit. In order to setup Clarifai configurations, I have to run the following command; as listed on its website: $ clarifai config But ...

SEND two attachment through the bat file (SMTP, BAT FILE)

This is my bat file: @echo off set yourEmail=xxxxx set yourPass=xxxx set smtpLink=smtp.gmail.com set emailSubject=EMAIL TITLE / SUBJECT set emailBody=EMAIL BODY set emailAttachement=n:\a\TEST\...

Run multiple commands without creating batch file using command prompt

My problem is this - In Win 10 user account, I created a batch file which opens a bunch of files. When I logout and log back in, the batch file just disappears! So I started looking at options. One ...

Reduce Findstr Output

I want to reduce the Output of the following Line: for /F "tokens=10" %a in ('c:\Programme\smartmontools\bin\smartctl.exe -a /dev/hdb ^| findstr /BC:" 9" ') do @echo %a This line is extracting the ...

net use command results in Status always as UNAVAILABLE

Hi i am trying to send the "net use" command through ssh from linux using python script. This i do using the schtasks.exe Here is the command that i use: "schtasks.exe /Create /S \"WIN-OPUQOKCV7CG\" ...

I need help on how to stop this batch-file from closing when an illegal character is entered by the user

I'm pretty much a novice and need help on how to stop this batch-file from closing when any illegal character is entered by the user... For example, when a users input is ";" or "&&" and the ...

Set name of text file to variable with cmd

I have directory C:\Test\NewName.txt and I want to take only the name NewName and put it in variable called X. The other problem is that I do not know what will be the name of the .txt file. I only ...

Batch File: Installation was unexpected at this time

Error: Installation unexpected at this time. The error occurs in the Highlighted (bold) echo statement after the application is installed when Im running this script on CMD. I have tried with ...

CURL Command To Create A File On Server

I have a mini program/server built on one of my computers (Machine1) and I am trying to create or overwrite a file through cURL on another computer (Machine2). So Machine2 is connected to Machine1. ...

Windows Command Line - Using an “IF/THEN” statement to check if a batch file is running

I've written a small batch file that converts a second batch file from an unusable file format to .bat, and then starts it. The first batch is still running. I want it to convert the second batch file ...

delete and add registry key .bat

I export the key I want to merge .reg file. Windows Registry Editor Version 5.00 [HKEY_CURRENT_USER\SOFTWARE\Autodesk\AutoCAD\R19.1\ACAD-D001:409\Profiles\bkkar\General] "...

batch file read and store in a text file string

So i have multiple files that when opened it looks something like this THis is header A|0003920449219349||||B|skej24ie422| F|ddawejaskld My question is how can I store the string in the second ...

Why I cannot copy with a variable name in windows batch file

I have a c:\test directory which has a text file var_list.txt with these 3 lines: abc xyz def I have a C:\test\source directory which has a text file source_file.txt. I have a C:\test\target ...

Why can not I find a file when copying to CMD?

Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("copy D:\\test112.txt \\\\192.168.36.26\\export"); Cannot run program "copy": CreateProcess error=2, Can not find the specified file When ...

Parsing SSH stream from batch

Using batch script to run ssh, I am finding all the output is dumped into the standard error... so my command: ssh -i keyfile user@host "commands" 2> error.log captures the remote server prompt ...

use the cmd command result in case statment

im trying to get the windows license status from cmd by running this code Dim oProcess As New Process() Dim oStartInfo As New ProcessStartInfo("cmd.exe", " /c cscript ""%windir%\system32\...

How to run multiple instance of PSEXEC command within a single computer

I have created a program in Java that executes a PSEXEC command. Whenever I run the program individually it works fine. But when the program runs 5 times at the same time, only the first instance was ...

How to echo a redirect command to a txt

I'm trying to create a batch script which will create another batch script. The problem is that one of the lines doesn't add and instead redirects to another file when it encounters the redirect that ...

running line after line in text file as mySQL query (cmd)

I have a text file where each line is a mySQL query. I would like to know how to run the queries line by line (loop) using cmd. Only know the following: mysql -h[host] -u[user] -p < input.txt ...

Using cURL to view contents of file

I am trying to figure out the command to display the contents of a file (text file) in command prompt using cURL and get. I had the right command but now I can't seem to get the correct syntax right ...

Is it possible to spool and append to an excel output in sqlplus

So I generate this excel output using sqlplus with the spool command in my sql script, but when I try to run another script and append the output to same excel file, it doesn't seem to work. The ...

Close Batch file from another batch with CTRL+C

I'm trying to CLOSE a batch from another batch USING CTRL+C; the available solution around SO are not useful. I'm looking how to send CTRL+C to the second batch when the execution of the first batch ...

makecert -e parameter - command failed

When sending the below command with -e 12/12/2017 (or a different date) it fails. The date is between the start and end date of the root certificate. I also tried to insert it on different places in ...

Find if substring is in string [duplicate]

I have a batch file that will prompt the user to provide a user name and password. I am trying to check if the password has the user name in it. I found this example but can't seem to get it to work: ...

Execute windows cmd prompt command through c# code. [duplicate]

I want to execute any sample command of cmd.exe through c# code. Eg. Time/ver this command i want to execute through c# code. 1. By opening cmd.exe and execute. 2. by hiding cmd.exe and get the cmd ...

Python CMD module: Shell quits after -h

this is my first question here so I'm sorry if any mistakes were made. I'm making a shell in python using CMD with some Youtube features, I have it almost done, functions work propertly but for some ...

CMD arguments in C# - freeze

I try to make some easy GUI for wifi hotspot but after click on the button on, it didn't write to the textBox1 and window go to freeze. I didn't try button_off yet. I'll be glad for any tips. Thank ...

ERRORLEVEL vs %ERRORLEVEL% vs exclamation mark ERRORLEVEL exclamation mark

I think i have a basic understanding of ERRORLEVEL vs %ERRORLEVEL% but !ERRORLEVEL! confuses me. I'm making a script that calls an executable, then tasklist to see if its running, then taskkill to ...

Batch File input validation - Password input meets complexity rules [on hold]

I have a batch file that will prompt the user to provide a user name and password. SET /P $userName= SET /P $userPassword= I use these values to create a Windows User account. net user %$userName% "...

forfiles with UNC path using two locations

I am trying to use forfiles to copy last 60 days files from one network location to another using the UNC path but I keep getting a 'UNC paths are not supported' error. Here is the script that I am ...

hide cmd in vb.net not working

I'm trying to hide cmd windows with vb.net without success. Dim oProcess As New Process() Dim oStartInfo As New ProcessStartInfo("cmd.exe", " /c cscript ""%windir%\system32\slmgr.vbs"" /xpr | findstr ...

Process.Start() and cmd produce different outputs

I need to perform SQLite database dump into another database file. For this I am planning to use SQLite Command Shell as I would really love to avoid ADO.NET stuff. The script I need to launch is ...

How to find non ascii characters from cmd in windows?

I have a big file which contains some non ascii chars. I need to find out those records. Note: I am not able to open the file using Notepad++ etc. I tried something like this from cmd : >findstr /R /...

How to specify local folder in batch code

I have the following batch file code and I would like to modify it to not have to specify the path/folder, meaning just run it from the folder I want to list. How should I modify the ("g:\files*") ...

CMD pstool need some advice

My script works fine, but in some cases useradmin account already exist in the computer in this case I want to just reset the password to bear123. what whould be the best way to do this? @Echo off ...

Sorting a file by value using cmd

Good day guys, i'm kind of confused with the SORT command in cmd im trying to sort a text file which is speed.txt which contains these values > time=1ms time=3ms time=267ms time=4ms ...

Batch file to unzip then rename its jpgs sequentially

I have this structure: Biographies <base folder> ----Elon Musk <person #1 folder> ----|---Modern-Day Genius <chapter name folder> ----|-------Elon Musk - Modern-Day Genius.txt <...

Creating self-executable node.js server

I would like to create an executable bash file that will execute the command node app.js - the goal is to have an executable file that can be opened on a local machine on which node is already ...

Command promt: Export the screen content to a text file but the process was before started [on hold]

How can I export all the content of the screen from cmd to a text file, but the thing is that the cmd was started before, in C# or console application

bulk rename with same file in folder

Ok, so I need assistance in renaming multiple files at once, all files contain _Compressed in the file name and I need this removing, the only problem I face is that the source folder contains the ...

Xcopy function to round out/ended directories with CMD

I would like to copy a file from a server to client computer. I am using: xcopy "\\server0007e3\c$\test.txt" "C:\new\" /s /i /y Since I have more than one server name, is there any way I can force ...

How to pass command argument from SQL Server database to cmd in Visual Studio C#?

I am trying to design an interface for my project. I need my Visual Studio button to generate some regression tree model, I used to put all the necessary file to generate the model (Input file and ...

Create a cmd window and write to it from C# application

I am developing a C# component for Grasshopper for Rhino. As I am running some pretty heavy iterative analysis I would like to output results continuously to a cmd window just to make sure that the ...

Java WIndows CMD error with command: java ClassName

I just created a .java file. (my IDE is NetBeans, java version java version "1.8.0_101" Java(TM) SE Runtime Environment (build 1.8.0_101-b13) Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, ...

How To Run Exe From USB Automatically

I am working on a piece of code i.e. the program copies an exe to USB device and then add two files in USB (1. Autorun[which doesn't work on my windows 10] 2. exe file). I need to know how can I ...

empty command line in c++ [on hold]

I tried to play with some conditions in Visual Studio 2015 but it seems that my Comand Line from Windows is not outputting anything in the end. Here is the code: #include <iostream> #include &...

capture result of wmic command to variable

I am trying to write a small batch script to install an app from a thumb drive. The problem is the drive letter changes when plugged into different machines depending on the available drive letters. I ...

Running system restore (rstrui.exe) within vb.net application

I have been trying to get the system restore wizard to start via my VB.net script but for the life of me it keeps saying "File cannot be found". Rstrui.exe is definitely inside the System32 folder and ...

Find if a computer is using DHCP or Static through CMD?

I am looking for a cmd command to return if the currently connected NIC is using a static or DHCP address. DHCP: YES or NO is acceptable. I think ipconfig might be an option, but I need a way to sort ...

How to suppress Windows CMD “Start” error message?

The Windows command "Start" issues a system message requiring user confirmation if the targeted process.ext does not exist. Start no_such_process.exe Results in the system message ... Windows ...
Translating... 0%