Skip to main content

Posts

Move folders in command line with specific string

Recent posts

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…

Linux copy files and change date or time

So, you want to copy files from one folder to another folder and change both the source and destination timestamp?
Linux can easily change or modify the timestamp with ‘touch’ command.
A one liner command with the help of ‘pipe’ to pass the arguments and ‘xargs’ to execute multiple commands in a single line can easily accomplish this task.
Command below will copy the files in the current directory where ‘ls’ command is executed to the directory ‘xfiles’, timestamp will be changed to 7 hours less from the current time.
ls | xargs -I % sh -c 'touch -d "7 hours ago" %; cp -p % ./xfiles';
-p option is important to preserve the modified timestamp
Note: the above command will change the timestamp for both source files and destination files.
Command below will change the source timestamp, but the destination timestamp will be the date and time that the command was executed.
ls | xargs -I % sh -c 'touch -d "2 Aug" %; cp % ./x';

Notice, that the -p option is omitted …

WSUS – quick installation guide

WSUS or Windows Server Update Services is patching system for Windows OSes and other Microsoft products.
In Windows 2016 or another version of Windows server it’s quite straight forward to install or config ure WSUS. Make sure the server has enough memory and has sufficient space to download and store updates.
Plan accordingly the computer groups in WSUS, like 1 group for Testing updates and 1 group for production or other methods or strategy that is right for the environment.
Configuring WSUS should be straight forward but in some instances, it may not work right after installing the WSUS server role.
First, install and configure WSUS server role.
Second, configure GPO to point to WSUS server. If the clients will not know where to find or report to a WSUS server then WSUS sever will be empty. WSUS server will not be able to detect client or server devices.
In GPO you need to set the settings of how you are going to carry out the updates, like the time to install the updates, and a notific…

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…