Click here to Skip to main content
15,891,607 members
Everything / Command line

Command line

command-line

Great Reads

by Bjørn
Using the FFmepg.exe to create video snapshots
by Mircea Neacsu
Parser for command line options
by Master DJon
Layer over System.CommandLine that overall eases Posix style commands integration into existing projects
by honey the codewitch
Easily crack your command line arguments into a dictionary with this code

Latest Articles

by honey the codewitch
Presenting a C# partial Program class to add core functionality to your CLI projects and get you up and running faster
by honey the codewitch
Easily crack your command line arguments into a dictionary with this code
by Master DJon
Layer over System.CommandLine that overall eases Posix style commands integration into existing projects
by Mircea Neacsu
Parser for command line options

All Articles

Sort by Updated

Command line 

15 Oct 2018 by #realJSOP
This CP article might help: Compiling C# Code at Runtime[^] You could essentially create a CSharpScript app that loads a text file that contains C# "script" code and compile that script at runtime. You could also write pre-compiled plugins for your script runner app, and specify the DLL...
8 Nov 2018 by #realJSOP
Try this: db2 "CREATE PROCEDURE TEST_PROCEDURE() BEGIN AS SELECT DECLINECODE FROM [DASUSR1].[DECLINECODE]; END"
8 Nov 2021 by 0x01AA
You mentioned command line, whatever this means... Now in past (very past) when one need to control external devices by 'type writers' aka 'terminals' it was very common to send control codes by Ctrl& What means now ? Have a look to the...
4 Jan 2017 by 23ars
A tool that I wrote some time ago called WinHexView which I used it for displaying file's content in different format like hexadecimal, decimal or octal
20 May 2014 by _Asif_
Well you can try below approach to see whether it works for youcreate CombinedBatchFile.bat and save below two lines in itcall yourBatchFile.bat > dump.txttype dump.txtAnd run CombinedBatchFile.bat. Though this wont be in real time but should serve your purpose.
18 Aug 2014 by _Asif_
There is no straight forward way to return value in loop from an application If this is what you are trying to do. What you can do is you can return one value to batch file like given in the below example and receive it in %ERRORLEVEL% variable in the batch file. Hoping this would help....
14 Jan 2020 by _Asif_
It's easy and a good example can be found here Visual C++ Enable Console - Stack Overflow[^] Do a little search and you will find plenty of examples more.
10 Jul 2017 by _m0n
Hi, how are you installing node-gyp? Have you added -g flag? npm list -g --depth=0 do you see node-gyp? Then, run cmd as Administrator and do: npm uninstall node-gyp -g then, run npm install node-gyp -g If it doesn't help, may be you need to clear npm cache or update node/npm itself? To...
5 Dec 2022 by Aalam Pratap Bedi
>>>pip install flask-login File "", line 1 pip install flask-login ^^^^^^^ SyntaxError: invalid syntax What I have tried: I am not sure how do I even proceed to solve this issue.
6 Dec 2022 by Aalam Pratap Bedi
(env0) C:\Users\AS\OneDrive\Documents\Python Project 01>python run.py Traceback (most recent call last): File "C:\Users\AS\OneDrive\Documents\Python Project 01\run.py", line 1, in from flaskblog import app ImportError: cannot...
22 Apr 2014 by Abhinav S
Use WCF. Here are some examples - ExpandWalkthrough: Creating and Accessing WCF Services[^]WCF Service Creation With C#[^]Introduction to WCF[^]WCF Tutorials[^]http://www.c-sharpcorner.com/1/192/wcf-with-C-Sharp.aspx[^]
23 Dec 2015 by AD89
I m developing a windows application that will use pdf2text pilot software which supports command line. In this application user needs to specify location of the pdf file. I m able to open cmd but could not pass commands to it or somehow my commands are not getting executed.Imports...
7 Apr 2015 by Afzaal Ahmad Zeeshan
All of these are compiler thrown exceptions (errors). Some say, identifier was expected (example context is when you miss the identifier while creating an object), some say Class doesn't end with exact matching End Class; check for any typo. Again that Module thing... Do you know the VB language...
8 Nov 2018 by Afzal Shaikh
Error: DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned: SQL0104N An unexpected token "DASUSR1" was found following "ECT DECLINECODE FROM". Expected tokens may include: "INTO". LINE...
9 Dec 2014 by AminMhmdi
I want to change year of calander and run Specific program and change year after program finishHow can i do this in batch file or powershell script ----------------------i find solution for PowershellSet-Date (Get-Date).AddYears(2) but also i want to do this in Windows Command Prompt
31 Jan 2017 by Ashwin. Shetty
Look at c# - Ensuring only one application instance - Stack Overflow[^] & Restricting a C# Application to a Single Instance[^]
17 Feb 2016 by azimkhandouzi
hello..i created a 7z archive yesterday.i want to add a few files to that, today , how can i do this by 7z archive command line.thank you...What I have tried:how can add file to 7z archive later
2 Apr 2018 by Babiiii
Good evening, I've been trying to create my own C# program that can message another Computer within the network. Unfortunately, none works. Please help me to make a C# Program that can pop-up message or notification message another computer within its network. What I have tried: I tried ...
21 Apr 2015 by bayotle
I have about 30 programs in vb6 which are part of a system and compile them all via a script with out issue but I'm not using VBC...My script pulls the project names from a directory and calls something similar to..."C:\Program Files\Microsoft Visual Studio\VB98\vb6.exe" /m...
6 Aug 2019 by Benktesh Sharma
Have you ever had a need to clean up all the history in the git repository? I will show how to clean the commit history in git using tools and technique using command lines.
14 Mar 2019 by bhargavvenkatesh
I have an application which was developed using php and I want to print a dithering image through my printer so what I am doing is I have an application called ImageMagick. In this application using command prompt I will pass an image path and the destination folder. So when I run the command in...
6 Apr 2015 by Bjørn
Using the FFmepg.exe to create video snapshots
31 May 2014 by Bjørn
A Windows batch script to import a physical disk into a virtual machine
14 Mar 2019 by Chad3F
Any errors would likely be going to stderr, not stdout. I suspect php exec() only captures stdout content (by default, if otherwise). You need to look at the server error log, not the browser, to see error messages from exec()'d programs.
28 May 2014 by chandu7x
Hi, I want to use try, catch blocks in cmd or batch files .Please suggest how to do it?Suppose I have 10 commands in a batch file.If any error occurs in 2nd or 3rd command then I need to capture that error.In cmd,we have %errorlevel% .But it captures only last executed run exit code.i.e...
7 Jan 2018 by charles henington
A simple workaround for FilePermission in monodevelop
5 Apr 2014 by CHill60
Firstly I should point out that having passwords in plain text is just silly - you may as well just put a post-it on the side of the machine.But to answer your question ...If you use scripting you can read text files ... have a look at this M$ article[^] and/or this list of links[^]It...
7 Jan 2015 by CHill60
If you're unzipping then you don't need that -min. The -e tells winzip that it's extracting and everything after that is the option list.Because you have -min first it would expect an x,n,f,s, or 0 after the -e
9 Jun 2016 by CHill60
Despite the fact this is off-topic, I'm going to give this a formal solution just to get it out of the list of Unanswered Questions.If you insist on doing this in a cmd window then you have 2 options.1. Follow the advice given by Sergey... Either have a buffer file to include in the COPY...
4 Sep 2014 by CPallini
Have a look at this MSDN page: "EndpointVolume"[^].
5 Sep 2014 by CPallini
That would just remove everything in / mount point.
22 May 2016 by CPallini
./a.out 5 : Memory leak, program loopsThis is the correct command line, so it succesfully pass your checks. However your program fails in the later Steps (you didn't post such code).
4 Mar 2018 by CPallini
I would use what GNU provides (Parsing Program Arguments (The GNU C Library)[^]). Since yours is an assignment it could not be a viable alternative.
2 Jun 2014 by DamithSL
try with FtpWebRequest , check How to: Download Files with FTP[^]How to transfer multiple files from FTP server to local directory using C#?[^]Or you can try one of Free FTP Library[^]
15 Jul 2015 by Dave Benham
It is true there is nothing built into the primitive batch language that even comes close to exception handling. Never-the-less, there is a surprisingly sophisticated and robust implementation of batch exception handling posted at http://www.dostips.com/forum/viewtopic.php?f=3&t=6497, and it...
22 Aug 2018 by Dave Kreskowiak
Your code doesn't make any sense. If the user doesn't pass in any args, it starts a Windows Forms app. If the user does pass in arguments, you add every argument to what appears to be a List (I have no idea because you never show the definition of mainObject!), assign the first two arguments to...
28 Jan 2020 by Dave Kreskowiak
First, SFC required admin permissions to run, so if you're not running your code as an admin, SFC isn't going to work either. Next, you execute the SFC command with a call to .Start, but then the very next line you call .ReadToEnd, which DOES NOT WAIT FOR THE PROCESS YOU LAUNCHED TO COMPLETE!...
24 May 2020 by Dave Kreskowiak
I don't think you have any options to that in .NET Core. The System.Management namespace will only work on Windows. Now, if the Process you want to start is an interactive one, meaning you're expecting the process to show up on the desktop of...
2 Jul 2021 by Dave Kreskowiak
Your shutdown command should be "shutdown /r /t 0". The /t is the amount of second to wait before shutting down the machine. Specifying it also enables the /f option, which forces all applications that are open to close without user interaction...
12 Nov 2022 by Dave Kreskowiak
Quote: The reason that makes it break is that all the characters i use to make the ANSI codes work are being treated as just normal characters when i use the string .length property. That's because, in the terms of a string, they ARE normal...
22 Jan 2015 by Deekshith Narayanam
I'm trying to write a simple batch file to take a remote desktop connection. But I'm not getting how to pass a program name, that I want to run on the remote system immediately after rdp session is created.Note: Using RDP client we can specify this thing under "Programs" tab.
7 Apr 2015 by den2k88
We can't see your code, nor access your HD in any way. Please give us more informations to work with.I may try to guess: as far as I know VBC exist for .NET projects - I don't have any similar utility in my VB6 Enterprise installation. Not only that but "namespace level" is a concept non...
22 Aug 2018 by Dinesh Kumar Dora
Hello friends, I am wondering if we can pass different count of commandline arguments to a console application. for example: test.exe test.exe arg1 test.exe arg1 arg2 test.exe arg1 arg2 arg3 all the above 4 cmdprompt invocations must work. Is it possible? i tried the params option as shown...
5 Sep 2022 by Duke Mitchell
I am attempting to understand and use MS signtool to sign an exe file with a self-sign certificate I generated in another Visual Studio prograam. I want to self-sign in the SignedFileTEST.exe outside visual Studio. I stumbled around and found...
8 Jan 2018 by Ehsan Sajjad
This is a step by step guide for beginner on how to install .NET Core 2.0 and create a Console Application without any IDE using Command Prompt/PowerShell
4 Apr 2018 by Eric Lynch
A flexible command line parsing class that uses C# attributes and reflection to discover syntax
10 Jul 2017 by fowwest
I uninstalled and reinstalled node-gyp, and when I go to the directory: C:\Program Files\nodejs\node_modules\npm\ , there is no \node-gyp\ directory. I've also checked to see if node-gyp even exists by using the npm ls command in this directory: C:\Program Files\nodejs\ It says that it...
26 Dec 2015 by Frank-Rene Schaefer
Using Quex to generate lexical analyzers
6 Mar 2016 by FrostedSyntax
How to create batch files that make navigating the filesystem in the command prompt a breeze.
14 Jun 2019 by Gabriel9999
I have directory where different type of files and folders exist. I want to list these files and folders inodes numbers with a single command in a single screen. How can achive that? Thanks. What I have tried: I have directory where different type of files and folders exist. I want to list...
31 Aug 2020 by Garth J Lancaster
Try setting it up like this Executing PowerShell scripts from C# | Microsoft Docs[^] I do like the using (PowerShell PowerShellInstance = PowerShell.Create()) { // ... } (using) to set up and tidy up the Powershell instance
8 Sep 2014 by George Jonsson
Maybe to late for an answer, but this info might get you started.How to Use the Traceroute Command[^]If you want to use this in a c# application, you can use the Process class and reroute the standard output.Process Class[^]How to spawn a process and capture its STDOUT in .NET?[^]
29 May 2016 by George Jonsson
Not sure which code block you want to keep, so I used the uncommented code.1. You should always use the using statement, as it will close the connection automatically or use try-catch-finally2. You forgot to assign the CommandText property3. You have an integer type in your parameter...
26 May 2022 by Gerry Schmitz
Redirect "standard input". process.StartInfo.RedirectStandardInput = true; process.StartInfo.UseShellExecute = false; Give user input for batch file via c# code - Stack Overflow[^]
9 Jan 2020 by honey the codewitch
Generate powerful, maintainable parsers in most major .NET languages using a friendly grammar format
22 Feb 2020 by honey the codewitch
Glory can parse virtually anything, even natural language. Add powerful parsers to your projects. Parse languages like C# or incorporate human language parsing with your AI code.
4 May 2020 by honey the codewitch
Start out with the basics for command line argument processing and exception handling for your console based utilities
23 Jan 2024 by honey the codewitch
Easily crack your command line arguments into a dictionary with this code
15 Feb 2024 by honey the codewitch
Presenting a C# partial Program class to add core functionality to your CLI projects and get you up and running faster
3 Aug 2014 by Irvan Munadi
Hi,recently i'm working in sap develpment.i need to emulate SAP console program via telnet serverso my hanheld device can telnet to that programi browsed and found this georgiasoft[^] that support VT220 to support F1 F2 F3 etc key in handheld. but this is commecial one.so i...
18 Nov 2022 by Jackie Lloyd
I am writing code in C#. My code has a command to run an exe from a shell command: $"/C {hospitalPath} /R {bdbPath} /M {bmiPath}"; It is a very obscure app called 'hospital'. The bdbPath and bmiPath are paths to files. If any of the files are...
12 Jun 2014 by Jani Mäkinen
Program return values inspected by .bat files with visual feedback
22 Jan 2017 by Javiertxl
My C# classes will create a GUI that takes in csv files and plot a line graph accordingly (Refer to: C# Read string from CSV file and plot line graph for graph code[^]). Currently, my graphs are plotted and saved using the GUI file dialog.What I am trying to do now is to read, plot and save...
7 Oct 2014 by Jaxam
In a command prompt I can type "ipconfig" and a list of internet information will appears. I want to do this in a C# console program. Basically, I want to run the C# program and I want to read and store everything that is given in "c:\ipconfig"."ipconfig" is a String in which that I can set...
15 May 2019 by Joan M
Hi all, I'd like to download all the files and folders from an industrial PC in order to automate a backup task. That should be done with a batch file. I've seen mget and get FTP commands, but it seems that is not working recursively and it only detects files as possible targets... folders...
19 Jan 2016 by Jochen Arndt
The arguments are passed to the main function where argc specifies the number of arguments and argv is the list of arguments. The first argument argv[0] is the name of the command itself so that argc will be at least 1.These parameters are passed to the QCoreApplication constructor that...
17 Feb 2016 by Jochen Arndt
Just type "7z" on the command line to show the available options:C:\Program Files\7-Zip>7z7-Zip [64] 15.14 : Copyright (c) 1999-2015 Igor Pavlov : 2015-12-31Usage: 7z [...] [...] [] a : Add files...
22 May 2016 by Jochen Arndt
a.out 5 5 :"No map size entered"This is quite clear (beside that the message text differs from the one printed by your code as already mentioned by Richard). Your code checks if exactly one argument has been passed and terminates when argc is not 2.With the above commands argc is 3 and...
31 Jan 2017 by Jochen Arndt
This is an often asked question:How to prevent an application to be started multiple times?There are multiple possible answers but the best is:Use a mutex.Examples can be found by searching the web likeC# Developing.net - How to prevent opening multiple instance of...
4 Apr 2017 by Jochen Arndt
Do you really want a file to be downloaded and executed with a single click or even in the background? That would be a security nightmare. So the answer is: There is no way to do this.
26 Feb 2015 by john1990_1
I want a ".inf" file content to add to .inf file, the code should open "Mouse Properties Window"This code adds mouse pointers to Mouse Properties window, i want a line to add in the end, that opens: "Mouse Properties", so the user can change the mouse set to this new one.;...
23 May 2023 by john1990_1
I want to runcontrol /name Microsoft.MouseTo open mouse cursors for user to change to the new ones...From a ".INF" file...This ".inf" file opens the mouse settings, I want to copy a sentence to other ".inf" files to open Mouse Settings.[Scheme.Reg]HKCU,"Control...
19 Feb 2020 by Josef Zdráhal
What's wrong on changing environment variables using Environment provider like $env:variableName = ? (see about_Environment_Variables - PowerShell | Microsoft Docs[^]: When you change environment variables in PowerShell, the...
22 Apr 2014 by Juan Miguez
I am currently investigating the use of "Batch Automation" using SOAP in a command line that is sent to the windows software to receive (SOAP) commands from other software mainly for batch automation.First I used a bunch of times "batch files", and perhaps I am mistaken or mislead by the use...
12 Mar 2015 by K.badari
Programmatically Convert PDF-To-XPS Document
23 May 2023 by K2here
you need to call the respective control panel file , in this case main.cpl is responsible for opening mouse settings tab (legacy) where you get the options to select the respective mouse theme installed. The call should look something like this, ...
14 Jun 2019 by k5054
The -i option to ls gives inode numbers. You might want to use -F option, which appends a '/' for directories, and '@' for symbolic links, and '*' for executables (plus a couple of others indicators we can probably ignore for now). e.g. $ ls -iF 872499 bar@ 13150 foo/ 1142157 x* ...
2 Mar 2024 by k5054
QP->start("/bin/sh", { "-c", "echo q | sudo -S hcitool info " + _ " addr" }) I'm not sure what the underscore is doing in there. Maybe a typo? Why on earth would you think that addr inside a quoted string would refer to a program variable? ...
7 Jan 2015 by kali siddhu
i am trying to unzip the files using winzip in command prompt.the file are unzipped but final one window is opening to show all unzip files.How can close the result window through command prompt.command C:\WINZIP\WINZIP32.EXE -min -e -o -j ...
31 Mar 2017 by KarstenK
There are different sorting algorhitms, so this tutorial at cprogramming gives you a fine lesson about sorting. tip: use Google
5 Aug 2018 by Karthickraj R
Hi, i want to run a bat file to the remote computer , with the same network. i have username, password for that remote computer. What I have tried: before i use paexec tool for running a bat file to the remote computer, but now i want to run a bat file without using any tools. please tell me...
17 Jan 2016 by Kasthuri Gunabalasingam
By using Vpatch commands , already generate a patch file based on original and new version difference. GENPAT oldfile.txt newfile.txt patch.patNow I want to restore patch files from my backup folder and merge it with initial file.I don't have clear knowledge about this. When I googled...
18 Jan 2016 by Kasthuri Gunabalasingam
I m trying to backup Folders from local drive to Dropbox using Duplicati command in Command prompt. (Backup should be Incremental)C:\Users\Desktop\Office_Works\Duplicati\Duplicati 1.3.4\Duplicati>Duplicati.CommandLine.exe backup a https://www.dropbox.com/Enter passphrase: **Confirm...
19 Jan 2016 by Kasthuri Gunabalasingam
please any one suggest a method (Command prompt line) to merge two files in NSIS script. (pat file and last version of the original file)I tried with this command, but couldn't get the output! vpatch::vpatchfile "patch.pat" "oldfile.txt" "temporary_newfile.txt"
7 Dec 2014 by Kornfeld Eliyahu Peter
The calendar is only reflecting the date and time of the system - change that you change the calendar...http://technet.microsoft.com/en-us/library/ee176960.aspx[^]
23 Jul 2017 by Kornfeld Eliyahu Peter
It is unclear why and how you picked this specific tool for the job, but as you did so I would except you to read the documentation... It has clear samples for installation and usage... GitHub - Mincka/DMArchiver: A tool to archive the direct messages, images and videos from your private...
3 Aug 2020 by l o o l
Something very similar I did some time ago, below is an adaptation / merging with your code and also using for... this is string %errorlevel% == 1 and this is int comparation %errorlevel% EQU 1 @echo off && setlocal enabledelayedexpansion...
1 Jan 2022 by l o o l
To echo your control character, try use a method that allows echoing/converting hexadecimal to character, some like: echo(0x02StringsToSend0x03 to: ☻StringsToSend♥@echo off for /f "delims= " %%S in ('forFiles /p "." /m "%~nx0" /c "cmd /c...
24 Oct 2016 by Leo Chapiro
This is simple: your call "add 0324782012" "set 0324782012 title Data Structures Using C++"You get argc == 3 and you can get argv[0] with "yourprogram" argv[1] with "add 0324782012" argv[2] with "set 0324782012 title Data Structures Using C++"The separator is the...
7 Oct 2014 by Maciej Los
Why to torture yourself by sending some command to the 'command prompt'?Isn't better to use .net classes, objects?Please, see:Network Programming in the .NET Framework[^]NetworkInterface Class[^]Quite often used alternative is WMI[^], which provides functionality to get information...
16 Oct 2023 by Master DJon
Layer over System.CommandLine that overall eases Posix style commands integration into existing projects
29 Jul 2021 by Member 10556393
I need to execute the below command prompt in Visual studio 2010. Cmd: Httputil.exe "aws s3 cp" C:\TEMP\Test1.TXT Here HttpUtil is the Visual studio project name. I need to pass "aws s3 cp" C:\TEMP\Test1.TXT
29 Jul 2021 by Member 10556393
What is this issue and how to solve it? Exception 1 of 4: System.ArgumentException: App.config does not contain credentials information. Either add the AWSAccessKey and AWSSecretKey or AWSProfileName. at...
21 May 2014 by Member 10590933
I am using iperf-2.0.5-2-win32 tool to find network bandwidth. I have written codes in c# which opens the cmd prompt, pass iperf parameters to start server side & client side. iperf-2.0.5-2-win32 exe will not open directly, need to open through cmd prompt only. At present the output(Transfer...
2 Apr 2014 by Member 10715106
I have a command line command which can unlock a folder using a password..eg: unlock 12345here unlock is the command and 12345is the password..i have more than 100 passwords in a text file each in a single line..i want a batch script to check each password to unlock the folder.i.e the command...
30 Sep 2019 by Member 11183856
I have a pcl file. I want to remove a line of data from pcl file. I don't have pcl line of data but i have normal text and my text is "c40Ec45Ec46Ec107Ec125Ec35Ec40Ec45Ec46Ec50Ec60Ec125Ec35Ec40Ec50E*c88E". I want to remove this line of code from pcl file. What I have tried: i tried to to get...
30 Oct 2019 by Member 11183856
How to write a "PCL Command"? write a text at background of the page like watermark text or image. I can able to write a text in PCL command and returns the output in PDF. But i need to know how to write watermark image or text to the background of the page. What I have tried: How to write a...
11 Nov 2014 by Member 11226668
Using Batch command i want to iterate through a perticular folder and check that files exist in other folder by file name only, Apped already existing file if exists.One more thing i need to do is that ignore this operation on .txt files.Let one folder is : D:\folder1Let another folder...
27 May 2015 by Member 11579826
Hi,I'm trying to find a way to disable UAC for a specific application using the command line. All I've found is a way to disable UAC completely for the admin but I need to only disable it for a application. I'll be applying this to a batch script. Any suggestions would be appreciated.
12 Oct 2016 by Member 12133830
I wrote a Server-Client model program in java, and it works great on eclipse. However, when I try to run the client via command line (in Windows 10), I can see the input that I type on my keyboard for stdin only after I press enter. Why is that, and how can I solve this? Here is the client...