Newest cmd Questions

Q&A for professional and enthusiast programmers

Script windows .bat - Get filenames from some folders

I have a folder with some files. (a.js , b.js , c.js ) I need get all files as string like this : text a.js b.js c.js (with text) i try this but not works $ECHO NO FOR /R C:\Directory %F in (*...

How to get the full path of the parent directory / upper directory of the the current directory in command line

as shown below, I have a batch file named 'Current Path.bat' being stored in 'C:\A\B\'. C:\A\B\Current Path.bat What I want to do is to output the full path of the parent directory / upper ...

Wrong username picked by the %USERNAME% variable

Some login problem came with my previous user account. Therefore, the Admin created a new User account for me in the same PC. PROBLEM: Now I have to write a common script (which will be used in other ...

NppExec - Move file to another folder respecting subfolder structure

I'm using Notepad++ for write my SA:MP server system, but i have a issue trying to organize my folders: I want to put my compiled files (.amx - like a resulting .exe for non-Pawn devs) in a separated ...

It is it possible to run this Windows command with Pascal?

I want to use this command with Pascal. Is it possible? for /r %i in (boom.lpi) do xcopy /Y "%i" z:\ I tried this: exec('p:','for /r "%i" in (boom.lpi) do xcopy /Y "%i" "%userprofile%\AppData\...

Running JavaScript from the windows command prompt

I wrote the following JavaScipt code which converts a binary number into a decimal number: (function bin_dec(num) { var x = num; var result = 0; for (var i = 0; i < x.length; i++) { ...

WinSCP batch file gets executed successfully via command prompt but not within a SQL job Step

I have a batch file that gets executed via the command prompt (CMD), however the same does not execute if called within a SQL job step. The batch job is opening a WINSCP session and transferring a ...

Batch script: Displaying variable “is not recognised as an internal or external command”

Good evening all, Please excuse the basic question - I'm attempting to create a script to make some jobs at my workplace a little more efficient. The script is designed to open a network share and ...

Batch file in WPF launches infinite windows

I just tried launching a batch file in a WPF app like this: Process process = new Process(); process.StartInfo.FileName = "Scripts\\Install.bat"; process.StartInfo.WindowStyle = ProcessWindowStyle....

The ^ gets doubled when sending string as pararmeter to function in batch script

This is my code: set var1="`netsh int ipv4 show interface ^| findstr /I Network`" call:GetEles %var1% goto:eof :GetEles for /F "tokens=1 usebackq" %%F IN (%~1) do echo %%F goto:eof When I check ...

How to send Command prompt output to android

I am creating an app in which it will send some command to server and i want to get the output of that command on client (android). Basically i am sending command "systeminfo" and the output is too ...

Sqlite output mode

At first I put the output mode to column and it works fine... then I change the mode to ASCII it didn't change the last line and after that when I try to change it again to column it printed in one ...

Script ignoring exit command and breaking out of function BATCH/CMD

This script I wrote is supposed to parse and pull the IP information out of WMIC. The issue is when it is used on a computer with only 1 DNS server entered, the script fails miserably. It appears to ...

New CSV by combining 2 csv files

I have 2 CSV files that has File1: Column1,column2 data1, data2 File2: Column3,column4, column5,column6 data3,data4,data5,data6 I have to create a new CSV file that combines both columns from ...

Batch command to find highest number in set of strings?

For instance: file.txt contains: 4.3 - random1 5.6 - random2 2.2 - random3 3 - random4 1.8 - random5 I need a command that will output the highest number only, not the preceding text. Ie. Output ...

Can't seem to get printing script to function remotely

I came across a printer install script that is copied directly from Google. It installs the print driver every single time you install a new printer, which takes forever, and you have to be on the ...

Psexec is not working as expected with psshutdown

I'm trying to use psexec, which is invoking a another batch: psexec \\10.134.1.207 -c -u ad -p pass C:\\[path]\batchname In this second batch I am using another pstools command, which is psshutdown: ...

Get rid of the blurry outline with SetWindowCompositionAttribute

I am writing an app that will use the undocumented SetWindowCompositionAttribute function to blur the command prompt background. However when using it, there is a weird outline that I can't seem to ...

Python - pass console command to 3rd party console application

i have a question, but it is difficult to explain for me: I have a application (let call it abc), that have their own console - this soncole runs via CMD like this: abc console console.xml abc ...

Add comma to the end of each line of a file using Windows batch file

I have a batch file that looks in several .RTF files (file1) for specific info then puts the name of the document in file2. I need to create a comma delimited file (file3) to use in a command line ...

Windows .exe created with cx_Freeze returns 0xc000007b error

I created a small script to test cx_Freeze, shown below: sqrt.py: import math sqrt = math.sqrt x = float(input('Enter a number:')) y = sqrt(x) print(y) input('Press ENTER to exit') I also created a ...

Batch file to merge all txt files in folder on beginning and end of each txt file

Hi guys I have folder with large number of txt files. start.txt end.txt text1.txt text2.txt text3.txt ... I need to create batch file/command who will merge files like this: start.txt -> text1....

Can't get CMD Output

So this is my code: private void CheckLastLogon(string computername) { string cmd = $"/C query user /server:{computername}"; System.Diagnostics.Process proc = new System.Diagnostics.Process();...

window 7 and 8. dir>list.txt sends file size unreadable

2016-10-18 09:38 PM 32ÿ032 error messages plus.docx 2002-10-18 02:19 PM 195 filestruc.bat 2002-10-18 02:20 PM 1ÿ588ÿ209 filestruc.txt 2004-03-07 03:26 AM ...

Difference in Delayed expansion of ERRORLEVEL on cmd prompt and win32_process

cmd /V:ON /c dir c:\<some non existing directory> & echo %ERRORLEVEL% Volume in drive C is PC COE Volume Serial Number is 9C37-D0B7 Directory of c:\ File Not Found 0 Lets run the ...

Editing for saving the cmd output

I'm trying to write the output from cmd into a txt and I cannot find what's wrong with this code: public class Primzahlen { public static void main(String[] args) { int limit = 99999999; ...

KNIME Command Line Execution - ClassNotFoundException

I'd like to schedule a KNIME workflow. The workflow does its job very good as long as I start it from the KNIME GUI application. When I execute the same workflow via command line, java complains that ...

What's is >> called?

I've found out what the difference between > and >> is. My question is this: In the context of command line code, what is >> called? As in: dir *.txt >> mytext.txt Double ...

What is the sysrmug commad? [on hold]

Somebody told me that typing sysrmug /s on windows command line increase ram or sometbing. Wanted to prove them wrong, but couldn't find documentation of that command. On the internet, i just found ...

Batch file to Open to New Working Directory with Text Pre-Populated

I've been trying to get a Windows batch program to work where when I open the file, it opens the command prompt in a new working directory with text on the command line prompt as well. So far I ...

Get Git Shell to run command after starting

You can do start powershell -command ls to open PowerShell and get it to list files. I'm trying to do a similar thing with Git Shell. Currently I have %LOCALAPPDATA\GitHub\Github.appref-ms --open-...

How to enable bash commands in Windows CMD?

So, here's what I want to know. I know there is bash on Windows, I have two Windows machines and both have bash installed. The difference (if I want to execute bash command) Machine 1 Either type "...

I wanted to map things

AppServerNameList=(........) DataServerNameList=(..........) I have this list and its mapped one to one . I need to write commands so as to map particular dataserver with app server. I will get ...

How To Set Error Response Configuration for Multiple sites in IIS server

I have a server that is running multiple sites(more than 100), each with its own application pool on IIS, and I want to set the error response configuration to return custom errors(404, 500 pages)for ...

C# UI automated testing - Does anyone succeeded to capture the command prompt window object?

I have an UI automated test developed with White. One of the cases needs to open cmd and write some commands. The problem is when I input the first command. I tried something like: Process.Start("CMD....

running cmd from java and gets its output

I'am running this code: public class JavaApplication21 { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException, ...

CMD: save website as textfile [on hold]

CMD: save website as Textfile how do I do that? for example from this Website: http://steamcommunity.com/groups/anomalygroup/memberslistxml/?xml=1 thank you for helping!

command console doesn't reset after program finished running

i'm running the following code in c (through the cmd console) : void main(int argc , char* argv[]) { if (STRINGS_ARE_EQUAL(argv[1],"server")){ printf("\n\n\n\n\n\t\t\tSERVER\n\...

CMD Variable for registry

Alright so I was trying to delete the shell data in the registry. I can get to it and get all of the information right, but I want to automate it for all users. The one I can use right now only ...

Batch file for data copy by user input

I have the following MS Windows batch file code: @echo off cd\ dir/s *.docx *.xlsx *.ppt *.docx SET /p input= %data% " copy "%data%" C:\abc\ pause This command shows all 4 types of extension list ...

How can i get a localhost services/tasks list? [on hold]

In my project, I need to read the services/tasks runs on other pc that connected to my lan(other loaclhosts).. How can i do that?

CDrom eject cmd while there is no Windows and i have only win8 DVD image [on hold]

I insert win8 image on my Alienware laptop. I can bring command prompt by shift+F10. My original Windows cannot bring up by any means. My alienware cdrom does not have button or a hole so how can I ...

running multiple command by java process builder and gets its output by bufferreader

I'm running following code : public static void main(String[] args) throws IOException, InterruptedException { ProcessBuilder pb = new ProcessBuilder("cmd.exe", "/C", "echo hello"); Process p ...

Batch file for dumping specific words

I have a batch file that does want I want it to do perfectly, it searches through all files in its directory, and dumps the string with the word I searched. However, I want to be able to enter 2 words ...

Inquiring about setting Mechanize set up [on hold]

Guys I need help with this. It's one of my first days at tech class and this is one of the opening assignments and am already lost. Can someone help me?

CMD trying to set variable in a loop

I'm working with windows' cmd and trying to set a variable in a loop. Here's the code I have: for /d %%a in ("F:\backup*") do set folder=%%a ECHO %folder% PAUSE I want to look for a folder with name ...

Uninstall ios apps using the Windows Command Line

I have a not jailbroken iPhone running the latest iOS 10.2 that we use for automated ui tests. Our UI Testing tool is TestComplete which requires Windows and installs the app for us through iTunes. ...

How to install windows service as current user

The code below is used in Java to create Windows service. When I run the batch file with jar its installing service as system. Can anyone please help how to install the service as current user? ...

Sending Many Command, Input and Keep the CMD Alive in VB Script or VBA (and not .net)

I try to send second command to cmd. in cmd maybe i should do this Microsoft Windows [Version 10.0.14986] (c) 2016 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>D: D:\>set /p ...

How can I delete multiple directories with a single batch file?

I would like to make a batch script that can delete multiple directories at once. I've searched the web, but only seem to find methods for deleting multiple sub-directories or files. So far I can make ...
Translating... 0%