All Questions
Tagged with command-line windows-7
1,085
questions
801
votes
8
answers
2.6m
views
How can I display the contents of an environment variable from the command prompt in Windows 7?
In Windows 7, when I start the Command prompt, is there any command to display the contents of an environment variable (such as the JAVA_HOME or PATH variables)?
I have tried with echo $PATH, echo ...
161
votes
16
answers
737k
views
How can I find out when Windows was last restarted?
How can I know when my computer running Windows 7 was last restarted?
I prefer a solution that doesn't involve searching the event log, but something like wmic or maybe cmd commands.
130
votes
6
answers
677k
views
Restart a Windows service from the command line
Is there a way to restart a Windows service from the command prompt?
114
votes
14
answers
259k
views
How can I always run the command prompt as administrator?
As a developer, I often have the need to open a command prompt for various purposes. For example, I use iisreset to restart my local web server.
I typically open the command window in one of two ways:...
106
votes
2
answers
455k
views
CMD cd to other drives except C:\ not working [duplicate]
Possible Duplicate:
Using cd Command in Windows Command Line, Can't Navigate to D:\
I am unable to cd D:\ or cd D: or to any other drives. I am facing this problem from last 2 months but ...
105
votes
6
answers
350k
views
Turn off display in Windows on command
Is there a way to turn off the display in Windows (7), preferably without using additional software?
Powershell script works fine, but leaves command-line window after turning on the display.
98
votes
22
answers
748k
views
How can I delete all files/subfolders in a given folder via the command prompt?
I would like to delete all files and subfolders using a batch file in Windows 7 and keep the top folder. Basically emptying the folder.
98
votes
10
answers
331k
views
How to check if a directory exists in Windows?
I would like to translate this Linux/Bash script to Windows shell:
if test -d myDirName; then echo "ok"; else mkdir myDirName; fi
It tests if a directory exists, and if it doesn't it creates it.
88
votes
5
answers
1.1m
views
How do I locate the MAC address of my computer?
I am unable to locate the MAC address in a new computer with Windows 7. I've tried ipconfig /all in the console to which I got no items match your search. I also tried getmac. A screen flashed very ...
87
votes
8
answers
598k
views
Can I get more information on what Windows Update is doing?
It often happens that I have to watch this screen for minutes:
I have no clue what's happening in the back. And I'm also not interested in watching the WindowsUpdate.log for changes.
I would love to ...
86
votes
14
answers
223k
views
Hibernate computer with a timeout from command line on Windows 7
I am trying to hibernate my computer from the command. I was using shutdown /s /t 20 to shutdown the the computer. I change /s to /h to hibernate and now it just returns the usage text as if it doesn'...
76
votes
6
answers
19k
views
How can I permanently change the Command Prompt in Windows 7?
I would like to change the prompt to $p$g$_$f permanently, but it resets itself every time I reopen the command window.
How can I get it to stay the same forever?
76
votes
8
answers
113k
views
Less or More in Windows?
Is there a command in the Windows DOS prompt that is equivalent to the UNIX less or more?
Basically, the problem is that when I type hg log, the output has too many lines to fit on the screen and I ...
71
votes
4
answers
40k
views
Which special variables are available when writing a shell command for a context menu
When extending the Windows' shell context menu (e.g. for adding an 'Open command here' prompt on directories), a 'command' key needs to be created in the registry.
The value of this 'command' key ...
71
votes
3
answers
64k
views
Command prompt hangs until keypress?
Problem:
For some reason once in a while my command prompt would hang until I press a random key, and it would continue operation as if nothing happened.
Occurrence:
This happens when I am running a ...
63
votes
9
answers
210k
views
What is the command to use to put your computer to sleep (not hibernate)?
I want to put my Windows PC (Windows 7) into a sleep state via command line (so I can bind to macro button on keyboard).
The power button on the PC is setup to but the computer to sleep (but it's ...
61
votes
12
answers
199k
views
How to make the PC speaker beep from the Windows 7 command prompt?
I'm running some lengthy video encodes using the Handbrake command line interface. After all my encodes are done, I would like to have the PC speaker beep, as I usually turn my large external speakers ...
60
votes
7
answers
23k
views
What does it do exactly if I click in the window of cmd?
Suppose I run cmd.exe and ping localhost. After that I ping localhost again but I click into the window and the ping stops until I press enter.
What happens exactly when I click into the window? Does ...
57
votes
9
answers
167k
views
How to copy a directory structure without copying files?
I have a folder with a lot of subfolders and files in them. Is there a way to copy the folder and subfolders directory structure without copying the files they contain, using cmd or powershell?
53
votes
17
answers
270k
views
How do you open the command prompt in Windows 7 with a shortcut key?
Is it possible to open the command prompt with Windows 7 with a shortcut key, and if it is, how do you do it?
I know that I can assign a shortcut key to it, but does Windows come with a shortcut key ...
50
votes
8
answers
66k
views
Is there any way to get the windows cmd shell to expand wildcard paths?
Occasionally, the cmd shell's inability to expand wildcard paths can really be an inconvenience. I had to pass 100 files in a directory to a program, and couldn't type *.ext. Instead, I used mingw's '...
49
votes
9
answers
125k
views
Got not sufficient privileges message in CMD when logged on as administrator
I was trying to use mklink command in cmd (I have Windows 7 OS) I was logged on as administrator, but I got:
You do not have sufficient privilege to perform this operation.
I used the same command ...
46
votes
8
answers
101k
views
Checking where a symbolic link points at in Windows 7
In Windows 7, how can I check if a file is a symbolic link or not, if a folder is a junction or not, and how can I check where they are pointing at (in case they are symlink/junction). Both in ...
46
votes
2
answers
434k
views
How to start a program with command line arguments on Windows' cmd with 'start' command?
I need to start a program (virtual machine) in the background with a start command on Windows' 7 command line. Normally you would do this like that:
start /b cmd yourprogram
But I need to pass some ...
45
votes
10
answers
92k
views
Windows 7 Administrator Command Prompt "Start in" Path
So, I know you can create a shortcut to an administrator-level command prompt (as described in this question), but what I'm seeing is that whenever I use such a shortcut, it always drops me into c:\...
45
votes
4
answers
76k
views
How to reset the looks of the Command Prompt window, in Windows?
I have made several customizations to how the Command Prompt window looks in Windows and now I want to reset it to its original state.
How can I do that? I just want it to look that way it does after ...
45
votes
4
answers
122k
views
Does Windows log programs that have been run/called?
In Windows, is there a log that records what programs were run/called?
While browsing the internet, viewing a static page with no ads, mouse clicks, keypresses, or miscellaneous plugins/addons/...
43
votes
6
answers
107k
views
How to run a VirtualBox VM from command line?
I want to know how to start a VirtualBox Virtual Machine (VM) from the command line (using Windows 7) as well as shut it down with the operating system.
What is an easy way to achieve this?
41
votes
17
answers
9k
views
How to delete a file that contains a backslash in the name under Windows 7? [duplicate]
Possible Duplicate:
How to force Windows XP to rename a file with a special character?
how to delete (invalid) files with colon in their name under windows
I want to delete a file named ...
39
votes
7
answers
161k
views
How to Execute ShortCut From Command line in Windows 7
We came with a scenario where we have to use Shortcut file (.lnk), which is on the desktop, to execute an application for a headless device (i.e, without manual intervention).
Is there any way to ...
39
votes
10
answers
147k
views
On Windows 7, is there a command prompt line that can start cmd as an administrator? [duplicate]
On Linux, we can use
sudo bash
to run a shell as the superuser.
On Windows 7, we can use
Start menu -> (in search box, type) cmd -> Right click on search result and choose Run as Administrator
...
38
votes
1
answer
118k
views
Importing .PEM certificates on Windows 7 on the command line
I need to import a PEM certificate on a massive number of freshly installed Windows 7 Enterprise machines.
Normally, I would do it through MMC → Certificates (Local Computer) snap-in → Trusted Root ...
38
votes
9
answers
29k
views
How to toggle Show/Hide hidden files in Windows through command line?
I often need to toggle between show/hide hidden files in my PC. I have been doing it the usual way,
Click Organize in an Explorer window.
Select Folder and search options.
Switch to View tab.
Toggle ...
37
votes
3
answers
73k
views
Enable/disable Windows 7 device via command line
I have a device that I often enable and disable using the Device Manager. I'd like to write a script to do this programmatically (that is, using the command line). I saw a program called devcon that ...
35
votes
2
answers
156k
views
Error in command line "The system cannot find the path specified."
Not sure what I did but since past 5 weeks but I am getting this error The system cannot find the path specified. when I run any command or start cmd. Here is what I get when I start command line:
...
35
votes
7
answers
37k
views
Cygwin from Windows is very slow/ laggy
Suddenly all Cygwin commands I start from the Windows command line have a ~10-20 second lag
before they execute, so that Cygwin becomes totally unusable. I already tried to reinstall without success.
...
34
votes
3
answers
28k
views
How to create batch file that delete all the folders named `bin` or `obj` recursively?
I have the need of deleting all bin & obj folders in a folder on my PC. So, I'm thinking of a batch file to do that but I'm not famaliar with batching file in Windows. Please help.
[Edit]
After ...
32
votes
5
answers
35k
views
Is there a Keyboard shortcut to close a Command Prompt window?
Is there any keyboard shortcut to close the Command Prompt window in Windows 7? Alt+F4 does not seem to work on a Command Prompt window.
I close it right now by typing exit and Enter at the prompt. ...
32
votes
1
answer
59k
views
How to recursively list files (and only files) in Windows Command Prompt?
Wanted:
I want a listing of files with full paths listed out recursively in Windows 7 through the command prompt.
I DON'T want folders to be listed.
Attempt:
This got me all files, but also included ...
31
votes
8
answers
262k
views
Uninstalling programs silently via CMD
Is there a way I can uninstall programs without the graphical interface and doing it via CMD?
31
votes
8
answers
118k
views
how do I enable scrolling in Windows command prompt?
I open cmd.exe and I wanted to see my IP address. So I typed in ipconfig but then all the output does not fit in the CMD window, so I can't scroll up and actually see the important stuff.
So how do I....
30
votes
2
answers
148k
views
How do I enable services on a Windows computer via a command line?
On my Sony Viao pcg-811124 laptop with Windows 7, I disabled all non-Windows services through msconfig. When I restarted my laptop, it booted up, but I cannot view the screen, even in safe mode. I ...
29
votes
3
answers
77k
views
Chkdsk Questions
Recently in running chkdsk /r on my system drive (platter drive, Windows 7 Ultimate 64bit) I've gotten back results like:
4 EA records processed
76 reparse records processed
Am I right in assuming ...
29
votes
6
answers
35k
views
How to list installed font families?
How can I list the family names of installed fonts on Windows?
Any command line utility or any registry paths?
29
votes
4
answers
85k
views
Excluding files of particular extension using DIR command on windows command line
if i want to see e.g. files of a particular extension only using dir listing, i can do that using the command:
DIR *.txt
And it shows all files with .txt extension.
Now i want to know is there any ...
28
votes
4
answers
114k
views
Determine the mapped network path from cmd window
I have a network drive - mapped to Z:\
Is there a simple command to know the full network path from cmd ?
I.e. if cmd shows Z:\ABC\, I had like a command to output \\networkDrive\MappedDir\ABC
net ...
27
votes
4
answers
11k
views
How can I widen the Windows 7 Command Prompt window?
How can I widen the Windows 7 command prompt window?
It's fixed at 80 columns in width and dragging the window edges won't let me make it any bigger than that.
26
votes
5
answers
63k
views
Where are the standard Windows prompt commands files?
If I type dir in the command line, I guess it executes a dir.exe hidden somewhere in the system. Is there such a file? Where is it?
26
votes
5
answers
44k
views
Windows 7 equivalent for ntrights.exe
What is an equivalent for ntrights.exe on Windows 7?
I need it to be able to be run from the command line.
24
votes
3
answers
118k
views
Why doesn't "cd D:" change the command context to D:? [duplicate]
Possible Duplicate:
Using cd Command in Windows Command Line, Can't Navigate to D:\
Every time I want to change directory context to another drive (D, E, F, or whatever..) on a Windows ...