Questions tagged [command-line]
An interface for interacting with a computer using typed commands in a text-oriented environment, as opposed to a graphical user interface (GUI).
13,013
questions
3
votes
1
answer
2k
views
What is the difference between properties `Name`, `Caption` and `DeviceID` (when executing `wmic LogicalDisk`)?
When executing the command line wmic LogicalDisk, several properties of all logical disks of the computer system are returned. Three of them are Name, Caption and DeviceID, having the same value per ...
2
votes
1
answer
2k
views
What's the difference between an "option" and a "switch?"
When running commands on Windows or Linux, it seems like the terms option or switch are used interchangeably. Is there a difference between the two?
1
vote
0
answers
115
views
OS X: Create user-groups, that are not shown in Systempreferences "Users & Groups" PrevPane
I created some hidden Users on OS X, using dscl . -create /Users/<usershortname> IsHidden 1, that work as administraters.
For some reasons, I like to place the HOME-folders of different groups ...
3
votes
2
answers
7k
views
Batch: Run with GPU command?
I have a laptop with nVidia and Intel graphics. When I launch a programm, by default it uses Intel graphics, but I can make it use nVidia.
Question: Is there a way to do the same(run it with nVidia ...
1
vote
0
answers
217
views
how can I get a Batch File to Delete a folder if it doesnt contain a specific file
Hi I'm new here and was hoping someone can help me with a problem I have. Over the years I have acquired a number of ebooks (several thousand). So I have decided to only keep my mobi and Epub books. ...
0
votes
1
answer
1k
views
Python script won't run from the context menu
Working on the basis of this post (and this follow-up post), I've tried adding a python script (which I've added to the path and so on, so that I can run it from the command line everywhere in the ...
1
vote
0
answers
89
views
Strange response from a HTTP server
I noticed an unfamiliar device when scanning my local wireless network. It had two open (listening?) TCP ports; TCP/80 (http?) & TCP/443 (https?).
In an effort to identify the unfamiliar device;...
0
votes
1
answer
4k
views
Is it possible to get the Process ID of an Executable started in a PowerShell script using he 'Call' (`&`) operator?
Here is my issue. I run a command line application within a PowerShell script using the Call Operator (i.e. the & symbol), such that it is:
& $PathToExe /switch:"lots of args" /anotherswitch:"...
1
vote
0
answers
15k
views
What command will ensure a Command Prompt window always stays on top/at the front?
I am writing a silly little program in batch, and I want to make sure the CMD window is always at the front of any other windows that are called by the program.
Here are a few lines as an example of ...
0
votes
1
answer
33
views
How to erase certain lines from 10000 files efficiently
I have 10000 files in a directory. I would like to erase lines so that I keep 2 lines in the header, 2 lines at the tail, and every 100th line in the middle.
For instance:
#header1
#header2
0 x ...
12
votes
1
answer
25k
views
List all packages from a repository
I have been looking how to list all packages from a repository and I couldn't find it.
For example, I add a repository (sudo add-apt-repository ppa:noobslab/icons) and I want to list all its packages ...
4
votes
2
answers
44k
views
Is there a way to cancel sfc /scannow in windows 7?
After launching the sfc /scannow resource checker from a command prompt or a batch file, is there any way to cancel the process or does the process have to be left to complete?
In Windows XP, sfc /...
2
votes
0
answers
3k
views
Java runs in batch but not Powershell
I have a batch file that runs a jar with a few parameters, works fine:
@echo off
java -cp bulkconfig.020.0005.jar com.hospira.bulkconfig.LoadConfig %*
I would like to add some more cababilities with ...
0
votes
0
answers
2k
views
What is the correct syntax to set Signal to noise (SNR) offset or target noise margin in ZyXel AMG1202 t10b
I tried to find CLI reference for my router (ZyXel AMG1202 t10b) but couldn't find it on their website (there is for older and newer models but not for this one) I already contacted their support but ...
5
votes
1
answer
15k
views
schtasks with multiple actions
I am trying to create a schedule task using command line which has multiple actions running more than one batch files in sequence among other things
SCHTASKS /Create /TN TaskName /SC ONLOGON
/TR C:\...
1
vote
1
answer
2k
views
Get path relative to batch file - not working directory
I have a batch file in E:\dir0\dir1 that calls exe0.exe in that folder. I need the first argument to the exe to be E:\dir0\dir2\dir3\script.js.
The problem is that the name of dir0 (and whatever ...
0
votes
1
answer
1k
views
ping command does not work without extension
all of a sudden my command prompt commands started giving problems.
when I run ping.exe it works but when I run ping it says, 'ping' is not recognized as an internal or external command.
same ...
0
votes
1
answer
5k
views
Could not start PsExec service on remote: The system cannot find the file specified
Here is the script I have compiled:
@echo off
REM This file assumes you have psexec installed
REM Ask for machine name or IP
set /p machine= Please enter the machine name or ip:
REM check for ...
0
votes
1
answer
109
views
How can I delete these leftover hard links?
I was working with many small files (about 1million) and for one reason or another had to create a bunch of hard links to them. Now I am trying to delete all this data, but can't. After removing the '...
0
votes
1
answer
53
views
Command line program keep logging output into seperate window
I'm using a bat file to run some ADB command. This is the content:
cd C:\AutoToolApx\AutoOffer\AutoOffer\bin\Debug
adb connect localhost:5555
adb -s localhost:5555 shell pm clear com.google.android....
8
votes
2
answers
9k
views
Watch with awk command
How do you watch a command like?
awk 'NR%2==0 {printf "%s %8.0f", $1, $5}' filename.txt
Preceding this with "watch" gives this error:
awk: cmd. line:1: fatal: cannot open file `{printf' for reading ...
3
votes
2
answers
2k
views
How to encrypt VM box via VBoxManage?
I've created VM box via Vagrantfile, however when I'm trying to encrypt the storage, I've got the following error:
$ VBoxManage encryptmedium aaa-bbb-ccc-ddd-eee --newpassword - --newpasswordid ...
1
vote
2
answers
1k
views
Using another program through Windows Command Prompt
I know that I can launch programs from the Command Prompt, but is there any way to enter commands after opening that program?
For example, if I open DOSBox from cmd, how would I enter a command in ...
4
votes
1
answer
2k
views
Tab completion for command arguments fail in Cygwin due to `.exe` extension
Is there a configuration option in Cygwin so that when Bash completes the name of the command, the filename’s .exe suffix is ignored (not included)?
Explanation of the problem
When using tab ...
0
votes
3
answers
4k
views
How to run exe file remotely?
I have an exe file placed on a remote server. I need to invoke it from other server directly/using a batch file. When I invoke using batch file it runs and it shows in the Task manager of invoking ...
0
votes
1
answer
2k
views
Calling a variable after underscore in Windows Command Prompt
In my batch file I am trying to call a variable after underscore. But the variable is not getting recognized if added after an underscore.
set /p X=Folder name:%=%
mkdir Delta_%X%
So windows was ...
3
votes
1
answer
1k
views
Add backslash if a string doesn't have it
I'm developing a command line Batch file on Windows 7. I'm trying to add \ to a dir if it hasn't.
This is only a test:
@echo off
set solutionDir=%CD%\
echo %solutionDir%
if [%solutionDir:~-1%] ...
8
votes
2
answers
40k
views
How to kill a particular process(excel.exe) from command line?
My command goes as below:
TASKKILL /FI "WINDOWTITLE eq Microsoft Excel - Book1 Mine.xlsx"
This works fine but when I save the same as "Book1 Mine.xsl" and run the same command.
TASKKILL /FI "...
8
votes
2
answers
13k
views
How do I check the current cmd aliases?
I know how to set command prompt aliases (using the doskey command) from another stack overflow thread, but given a command prompt, how do I find out which aliases are already set?
1
vote
1
answer
2k
views
Background process with stdOut/StdErr output in files and console
I want to SSH into a machine, start a process, write the stdErr and stdOut of the process into two seperate files while reading the stdOut/stdErr in the console. As soon as some specific lines were ...
1
vote
1
answer
1k
views
Different result from command line prog when run by Task Scheduler
I call the following program from within another command line prog...
:: NT_getdate.cmd return yumd-date in var='ymd'
@echo on
setlocal
for /F "tokens=2,3,4 delims=/ " %%g in ('echo.^|date /t') do ...
0
votes
1
answer
255
views
Certain console apps "automagically" open a new console
Without installing anything new, certain console apps (eg xxcopy, diskpart) began to open a new console instead of displaying the output in the current console as usual:
If I run CMD, a new console ...
0
votes
1
answer
146
views
Why is php cgi loaded in path when doing a 'sudo su <user>" vs just being logged in which uses php cli?
When logged in as root user, php loads the correct version which is php cli.
But when i do a sudo su < user >, php is is loading the cgi version which is breaking some of my applications that ...
1
vote
0
answers
112
views
view files returned from shell commands
Very often I grep and find through directories (usually containing images) and I have to "visually" check the result before I can operate on the result (like deleting, moving, etc).
E.g.:
find ./...
2
votes
3
answers
13k
views
Windows Command Line - List Network Adapter Components
I'm looking for a way to, in a batch file, get a list of the components (such as NDIS drivers) in use by each network adapter on the system. Here's a screenshot of the info I want in the network ...
0
votes
0
answers
1k
views
How to direct (Python) error messages printed in a PowerShell console to a text file
Firstly, the errors I'm interested in redirecting are NOT PowerShell errors, but those generated by a Python script that is called within my PowerShell script. I have read multiple post on here (and ...
1
vote
1
answer
71
views
Why is my code for checking for an internet connection failing?
I am trying to edit a script so that it will check for an internet connection before executing the rest of its commands, but the problem is that no matter what I try the result (online or not) the ...
6
votes
1
answer
4k
views
Controlling encoding of redirected win console command output
Here is what I want to do:
Redirecting properly the output of console applications (I use the term command in the rest of the message) into a file with 1252 encoding (to make it readable from any ...
1
vote
0
answers
2k
views
Having a message box used as a variable in batch program
I am attempting to have a batch program pop-up with yes or no options and depending what the user clicks will determine what the program will do.
for example:
@echo off
Echo x=msgbox^("Yes or No?",...
4
votes
3
answers
23k
views
How to find count of lines present in a file using batch script
I want to count the number of lines in a file using batch.
I have gone through this, but couldn't understand as I am a beginner. I have written my own piece of code with basic knowledge.
@echo off
...
0
votes
0
answers
729
views
How to find mp3 files on a remote server using Powershell
I have created a powershell script to search for mp3 files on my workstation.
This is successful on my workstation, how can I run this on my network of 80 workstations?
$strComputers = Get-Content -...
0
votes
1
answer
1k
views
What does these command do in command prompt?
xcopy /E /V /I /F /Y "C:\Program Files (x86)\Diablo III" "H:\programs\Diablo III"
cmd /C rd /S /Q "C:\Program Files (x86)\Diablo III"
cmd /C mklink /J "C:\Program Files (x86)\Diablo III" "H:\programs\...
3
votes
2
answers
22k
views
Registry keys for automatic time and time zones
Windows 10.
I would like to know the registry keys responsible for "Set time automatically" and "Set time zone automatically" in Settings > Time and Language so I can modify them using the command ...
16
votes
2
answers
22k
views
Is there a difference between a command line flag and a command line option?
I am hearing these two terms interchangeably and I am wondering if there is any difference between them, like flags are for one letter options or flags are after a single dash.
1
vote
0
answers
256
views
zoompan filter creates shaky image?
I try to perform a basic zoompan with FFmpeg. I have an input list image (.jpg 400x300) and i create slice image video (.mp4 400*300) from it, with a zoom each image. This is my command:
ffmpeg -y -...
19
votes
2
answers
57k
views
Windows - Run process on background after closing cmd
I have a Python script which I want to run as a background process on Windows.
I can do that on Linux with:
python script.py &
and then disconnect the process from the terminal with:
disown
...
-1
votes
2
answers
188
views
How can I re-hide previously hidden files?
Previously I used attrib -s -h -r /s /d to un-hide all hidden files in D:\.
How can I re-hide the previously hidden files that are hidden by default? Most of them are desktop.ini and Thumbs.db
-2
votes
1
answer
12k
views
cmd: Find first letter from a string
I've no knowledge regarding cmd programming syntax. I have a text file containing user IDs which I need to delete using curl command and for that I need to extract first character of every user ID and ...
1
vote
1
answer
150
views
grab history command and args for different commands
I have the following exercise:
47 vim wilson.0321 wilson.0329
I need to grab the last command and args to create:
vim wilson.0329
right now I can grab the last arg or entire command:
...
6
votes
2
answers
2k
views
Cygwin paste long line is inserting newline at wrap point
I'm having issues with Cygwin's Copy/Paste functionality on a fresh install.
If I scrunch my cygwin window small, and then type a command that is wider than it is (such as echo ...