Skip to main content

Posts

Showing posts with the label Command Prompt

Windows delete recent items history

How to delete "recent windows items" or the links of the files you've open in Windows 10 or Windows 11? Here are the locations that will delete the windows recent items. Please test on a VM or any test device before applying to the actual computer or device. Make sure the output is what is expected. Open a command prompt and change directory to this locations: cd "%APPDATA%\Microsoft\Windows\Recent Items" cd %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations cd %APPDATA%\Microsoft\Windows\Recent\CustomDestinations Yes, please test on a Virtual Machine before applying to a production laptop or computer. Cheers! Till next time. Do ASAP, Always Say A Prayer... Practice O.T.G. = Obedience To God Make time for Prayer and Meditation. Take time to kneel down and Pray! Practice F.IF.T.H (Firm In Faith Towards Heaven) Your attitude will depends your altitude, stay humble!

Set or create a task scheduler using PowerShell or via command prompt

Task Scheduler in Windows or Cron in Linux is a life saver on the Sys Admin world. Why it is a life saver? You can set a scheduled task and forget about it. Of course, provided you have already carefully examined and test multiple times what will be the output when the Task is triggered. Yes, set and forget; once you are confident enough that everything will go smoothly. If there are task that needs to be run at midnight or early hours in the morning, Task Scheduler will come in handy. So, how do we set a Task Scheduler using PowerShell or Command Prompt? Why need to learn both? And not just PowerShell? Well, command prompt is always available on all Windows distribution. While PowerShell might be available on newer Windows system but then some restriction might be in place for security reasons. Therefore, it is good to be familiar with both PowerShell and Command Prompt executable files. PowerShell code snippet below shows how to set or create a Task Scheduler. PowerSh...

Check Windows Task Scheduler Status and Last Run Time

Task Scheduler is an awesome tool that every Sys Admin should be familiar with it. Task Scheduler in a way can help automate task, if the task is repetitive or a task that has to be done at a certain date and time, or a task has to be done once a week, once a month or even once a year. Task Scheduler is the best tool for this scenario. In this busy world of digital technology, who can keep remembering that a task must be done on a specific date and time. Yes, it might works once but as time goes on and task or jobs of a Sys Admin keep filing up chances are the task might be forgotten and the person-in-charge might just remember the things that needs to be done if there is an issue that happens already. So, Task Scheduler is a tool in which you test once, set if tested okay and forget about it. Test to make sure that the task to be set, works properly and just forgot about it; it will do the task repetitively albeit depends on the settings that was set. Of course, Task Scheduler...

How to check office version from command line

The are quite a few ways to check office version it can be done via registry, PowerShell or VBScript and of course, good old command line can also do it. Checking Windows office version whether it is Office 2010, Office, 2013, Office 2016 or other version is quite important to check compatibility of documents; or just a part of software inventory. For PowerShell this simple snippet can check the office version: $ol = New-Object -ComObject Excel.Application $ol . Version The command line option will tell you where’s the path located; the result will also tell whether office is 32-bit, 64-bit and of course the version of the office as well. Here’s the command that will check the office version and which program directory the file is located which will tell whether it’s 32-bit or 64-bit. Command to search for Excel.exe: DIR C:\ /s excel.exe | find   /i "Directory of"  Above command assumes that program files is on  C: drive. Sample O...

WMIC command get CPU Load Percentage

Getting CPU load percentage is quite helpful in determining whether the server or computer is on a heavy performance, this would also indicate whether there is a need to increase the memory or add another CPU to the machine. Of course, when the CPU has a lot of load, performance will be impacted directly. Which basically means that the machine will not be working perfectly. Checking the CPU load will also help to troubleshoot, if the services on the machine or server is experiencing slow performance. Here’s the wmic command line which check the CPU Load Percentage. wmic cpu list status Sample output: Availability   CpuStatus   CurrentVoltage   DeviceID   ErrorCleared   3                              1                      9     ...

Copying files in AWS S3 bucket

Learning to copy files to S3 bucket or from S3 bucket to local folder is a must thing to learn when administering S3 bucket. S3 bucket is an object storage.   See details on this link: https://aws.amazon.com/s3/features/ An S3 policy called WORM (write-once read-many) policy can be enforced to S3 bucket. WORM is ideal for log files.   Backup or write the log file once and read it many times if someone needs to read or review the logs. Let’s get into business, how to copy files to S3 bucket? S3 is an acronym for Simple Storage Service. S3 accepts Linux command, so if you are running Windows be careful when typing S3 commands. A simple mistake of running Capital letters can ruin your day since the command will not work and the error won’t be friendly to tell you that it was just a simple mistake that you just type in capital letter. Copying is plain simple, so here’s a basic and simple example: aws s3 cp test_bucket.txt s3://thes3bucket ...

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_ARCHITECTURE     REG_SZ     AMD64 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_IDENTIFIER     REG_SZ     Intel64 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\Envi...

Change windows service startup type via command line

To change windows service startup type, can easily be done via the graphical interface or GUI. And it's quite convenient doing via GUI if it is one or two computers. If the settings have to be done on multiple computers then it's not efficient to do it via GUI and quite a hassle also since the user has to stop from his/her work. To do things efficiently and save time, it’s better to make changes via command line. To change startup type via command line on multiple servers or remote computers can easily be done using the "SC" command line program. Example below shows how to change start up type service. SC \\Remote_PC config start= option_type Option Type is: Disabled, Delayed-Auto, Auto, Manual The space after start= C:\>SC \\PC007 config MBAMService start= delayed-auto Command above will change MBAMService to Automatic Delayed Start If the command has exectued successfully it will show this message below: ...