Skip to main content

Posts

Showing posts with the label Windows

Move folders in command line with specific string

How to move folders in command line without selecting manually the folders?
Manually moving folders is quite ideal if there are two or three folders that needs to be moved. But if the folders are quite a lot and doing it manually is a bit tedious; besides chances are there might be folders that will be missed out.
Command lines and some basic editing in notepad can ease the process of moving folders it can be run via batch file or just simply enter the command at the command prompt window.
Assume that all folders have the word “old-data” as part of its folder name. It can be any string as long as it’s common to all the folders that needs to be moved or archived.
First step, is to open a command prompt window then change directory to the folders.
Example: c:\cd sales_data
Then at sales_data directory type:
dir *old-data* /s/b > file_old_data.txt
replace old-data with any string that is common to all folders.
* is used between the string, which basically means that look for folders with this …

Check if 32 bit or 64 bit processor from command line

How to check processor architecture whether its 32bit or 64bit?
One method is to query the registry from the command line.
Here’s a one liner command line that will check whether the PC processor is 32bit or 64bit.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" | find “ARCHITECTURE”
If the output is something like this:
PROCESSOR_ARCHITECTUREREG_SZAMD64

Then it’s a 64bit, if it shows x86 then it’s a 32 bit.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" | find “IDENTIFIER”
Above query can also identify, the output shows Intel64 for 64bit.
Sample Output: PROCESSOR_IDENTIFIERREG_SZIntel64 Family 6 Model 142 Stepping 10, GenuineIntel

Omitting the find option from the “reg query” command will show quite a few information.
reg query "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
This query command works in Windows 7, Windows 8 and Windows 10. I believe this will also work in Windows s…

How to open an elevated command prompt from a standard account?

Working in a fast pace environment, will need to get things done quickly to do other tasks that needs to be done also.
Opening a command prompt in a standard user account without signing off and without logging off is possible with the “runas” utility command in Windows environment.
Open the run box and type “cmd”, to open the command prompt window.
Then type:
Runas /user:admin_account cmd
It will ask for a password, if authentication is valid then a new command prompt window will open in an elevated mode. Command works from Windows 7+  version.
That’s it, you just open an elevated command prompt window in a user standard account. Since most users are hungry with the admin password, just watch out with the shoulder sniffing tactic.

Other useful admin commands in a windows environment:
If ever you have a custom local admin account name and you can’t remember, type: net users
It will display all the local user accounts.
To check domain name and current login user account name, type:
Who…

Ping IPv4 or IPv6 in Windows 10

Windows 7 and newer releases of Windows supports ping results of either IPv4 or IPv6.

If the remote PC or server is configured for both IPv4 and IPv6, and if you need to ping via hostname and you want to get an IPv4 address type the command below:

ping -4 -n 2 Dhoney_Srv

Output will be IPv4 address of the hostname

ping -6 -n 2 Dhoney_Srv

Output will be IPv6 address of the hostname.

-n 2 send two ICMP packet requests.


Cheers! Till next time.


================================ Free Android Apps:
Click  links below to find out more:
Excel Keyboard guide:
https://play.google.com/store/apps/details?id=chrisjoms.myexcelapplicationguide
Linux Android App cheat sheet: https://play.google.com/store/apps/details?id=com.LinuxMobileKit
Heaven's Dew Fall  Prayer app for Android :
https://play.google.com/store/apps/details?id=soulrefresh.beautiful.prayer
Catholic Rosary Guide  for Android:
https://play.google.com/store/apps/details?id=com.myrosaryapp
http://quickbytesstuff.blogspot.sg/2014/09/how-to-recite-rosary.h…

Activate Windows from command line

How to activate Windows from command line?
If you have decided to convert an evaluation Windows server (Windows 2016 or other server version), or Windows 10 to a license Operating system then you need to replace the product key. You will need to change the product key and activate the system, in order to use the product outside of its evaluation period.
Assuming you have done the steps of converting the evaluation software and all the evaluation packages has been removed. Of course, if you have plenty of time in your hands and you just want to redo everything then you can just install or setup a new environment.
To activate a new product key from command line, first the product key must be installed and replaced the existing one. Second, activate the product key.
Here’s how to do it via command line:
a. slmgr /ipk windows-product-key-with-slashes
/ipk = installed product key windows-product-key-with-slashes – replace this with the actual windows product key
If everything goes well there will b…

How to print files without opening

How to print multiple files with opening them?

How to print multiple PDF files in one go?

Printing is an easy and straight forward task, but if you need to print a 100 or more files but time is a constraint then you have to think twice how to do it fast and easy.

Of course, open, click and print is the usual method of printing.

To print multiple files without opening them in Windows, just go to devices and printers.

Double click the printer and it will open a printer task window which shows what files are being printed.

In Windows 7 if you right click the printer name, click on "See What's Printing".

If you need to print in double side the printer has to be set before printing because it will just print automatically with the default settings.

This method works well for a Fuji Xerox printer, but it should also work with other brand of printer.

See screen shot below:



Cheers! Hope it helps to make things faster.

Till next time...


================================ Free Androi…

Add a user in command line in Windows and Linux

How to add a user via command line in Windows and Linux?

Adding a user whether in Linux or Windows requires the user have rights to create.

In Windows you must be a member of the administrator or other groups who has the rights to create a user.

In Linux you must be a root or either a member of the sudoers depending on what distro you are using.

In Windows to create  a local user in a Windows client operating system such as Windows 7 or Windows 10.

A one liner command can be issued to create a local user, using the command prompt Window at an elevated mode or administrator mode.

At the command prompt type:

Net user  "username" "password" /add

Net user  << this should be type like that it’s part of the command syntax while username and password, can be any data and of course /add is needed meaning the command is adding a user to the system.

Example: net user spiderbond 007-homeSp!dey /add

Command will add a user name called spiderbond and the password is 007-…

Access denied renaming shared folder

If you are working in a shared active directory environment and has a shared folder that needs to be renamed once in a while.
But every time you want to rename there is always a user who is using the folder and therefore, renaming the folder is denied.
How to rename the folder when the shared folder is always in use?
Automation will come for the rescue in such a scenario.
How to automate renaming the folder?
Task scheduler and a simple batch file can do the task and a life saver.
Here's how to do it:
Of course, disconnect all the open files. Users should shutdown their computers when they went out of the office,
If they don't shutdown, force their disconnection by using the command below:
openfiles /disconnect /o read/write openfiles /disconnect /o no access
Then, rename the folder with the ren or rename command of course.
Syntax is the good old fashioned source folder or path and the new folder name.
If the batch file will be run directly on the server, then the drive letter w…

Find or search files in Windows

Search files recursively using PowerShell or the old good dir command line.
To search using PowerShell:
gci d:\ -recurse | where-object {$_.name -like "g*.txt" }
GCI – a short form for Get-ChildItem Recurse – is to search recursively (folder and sub-folders) G*.txt - * tells the PowerShell to search any document that start with g and don’t care anything that follows it
To do it using the old way via command line, open command prompt and type:
Dir /s d:\ g*.txt
To save the search output just use the “>” redirect operator.
Dir /s d:\ g*.txt > d:\G_filenames.txt
/s - parameter to search recursively (folder and sub-folders)

The search result will be written to G_filenames.txt
In PowerShell to save the search result type:
gci d:\ -recurse | where-object {$_.name -like "g*.txt" } | out-file d:\gxfiles.txt


If you still want the very conventional way of searching.

Minimize all windows folders by pressing "windows key" + "d", win d (press both keys a…

Excel find last row with value in a specific column

1. How to find last row with value using vba in a specific column?

2. How to find last row with value  using vba in a worksheet?

The questions above are entirely two different scenarios.

The first question will find the last row with value in a specific column within the worksheet.

While the second question find the last row with value of the entire worksheet.

The first question is applicable if you need to find the last row in different columns.

Let's say Column 1 or Column A, or Column 2 or Column B etc.

Example code below will find the last row in a specific column via VBA code.

===================
'command Cells(Rows.Count, 1) = find the last row with value in Column 1 for Sheet3

Dim last_row As Integer

last_row = Worksheets("sheet3").Cells(Rows.Count, 1).End(xlUp).Row

Msgbox last_row

'replace 1 with the desired column 
'ex: command Cells(Rows.Count, 7) = find the last row with value in Column 7
===================

If you don't need to specify a worksheet or…