Showing posts with the label cmd search

Disconnect Remote Desktop from command line

How to kill remote desktop sessions from the command line?
How to close RDC sessions from the command line?
One solution is to use batch file scripting or use PowerShell.
For old timers batch file might be the preferred solution because you don't need to install anything, it  comes in handy with the native command prompt.
Of course, PowerShell is also one of the best solutions; provided the environment is PowerShell ready.
The method used below utilizes batch file or the command prompt, just like the good old DOS environment of yesterday.
Command below can be run directly from the command prompt.
To use batch file scripting open notepad and save the file with ".bat"  file extension. Once saved as a batch file, the script is ready for automation with the help of Task Scheduler.
Here's the command:
for /f "tokens=2,5" %a in ('netstat -ano ^| find "3389"') do echo %a & tskill %b /v
For folks who just started to embark in batch file world,…

Windows delete files in all directories

Deleting files are good and bad.
It is good to delete files because it will tidy up your computer, get rid of unwanted or outdated files and free up space on the drive.
It is bad to delete file or files if no backup is available and the data is of great importance.
So deleting files should be done carefully and cautiously to make sure that deleted data will not be needed anymore.
How to delete files automatically in all folders and subfolders?
The batch file will come handy to automate file deletion.
Below is an example that deletes files on the temp folder for any “dll” files.
This can be applied to any folder path but don't do this on the c:\windows folder or the system will be completely unusable.
Open a command prompt and copy and paste the commands below or save it to notepad and run the script as a batch file.
C:\Users\\AppData\Local\Temp>FOR /f "tokens=*" %a in ('dir *.dll/B /S') DO del %a
Above command will find all the “.dll” files on the temp folder …

Rename interface or network adapter name using PowerShell or Command line

How to rename interface or network adapter name using command line or Powershell?

In  Windows network connection window, it shows the list of available network card on the computer, NICs are listed with its name, interface card vendor name (like Intel(R) I350 Gigabit) and its connection name whether it's domain network, local network, private or other network connection name.

Network connections window can be access by typing "ncpa.cpl" from windows run box. Or typing "control cpa.cpl" from command line. Of course it can also be access via GUI from the control panel or task bar.

To rename Interface name using netsh via command line:

Netsh interface set interface name="Local Network" newname="Private LAN Network"

If the server or computer has multiple nics; its better to set the interface name with identifiable name that best describes the interface connection.

Netsh interface set interface name="Local Network" newname="NIC 1 W…

Windows search location of files

Search directory and path location of Windows files using “where” command.
Where is a command line tool. Since it's a command line tool it can be automated using a batch file or any scripting of your choice.
Here’s an example of where command:
where /R  c:\users\username *.doc  *.xls                   
Command above will find all document files and excel files in folders and subfolders of c:\users\username. /R is an option to search recursively.
The above command just use a space as a delimiter to set a parameter for other files to include on the search.
The complete path and file name for all files matching will be displayed.
But it’s better to specify a specific path; the more folders to search recursively then the longer it takes to find the matching files.

 where /R  c:\users\ My*.doc 
Command above will search for documents a file that begins with “My” on its filename. The path is on C:\users, if the user is executing has proper right to access the folder of other users. Th…

Change product key in Windows 10

How to change product key in Windows 10?
Microsoft has provided an easy way of changing the product key in Windows 10 by launching an executable file via command line.
Open command prompt, press together the Windows Key + R key to open run box.
On run box, type "cmd" (don't include the quotes) and press enter or click the ok button.
If the user account is not running with administrative privileges, system will prompt to enter the username and password for the account with admin rights.
If the user account has admin rights, the command prompt window will open.
On command prompt environment type: changepk and press enter
Changepk.exe is a shortcut name for change product key.
A window will open to enter or change the windows product key.
See screen shot below for an example:

Cheers..Hope it helps.. 

Free Android app, download at Google play:
Android Divine Mercy Chaplet Guide…

Quickly access command prompt or control panel in Windows 10

How to launch or access command prompt, control panel and programs and features in Windows 10?

Microsoft provides a quick easy on how to do this.

To launch "Programs and Features",  "Disk Management" and elevated command prompt can also be quickly access using the method below.

On a laptop or desktop PC with Windows 10, right click on the windows logo, or the windows start button and a pop up menu is shown. See screen shot below:

The windows run box is also part of the menu which provides quick access to run or open programs.

Windows run box provides quick access to most of the programs if you are familiar with the application name.

For example to launch Microsoft paint brush you can easily launch it from the run box by typing "pbrush" (don't include the quotes when typing).  Or to run word type "winword",

If you have been using snip to capture images on your screen, you can also launch it using the run box by typing: snippingtool

To quickl…

Check Task Scheduler using command line

PowerShell search for files

Find current wallpaper in Windows 7