Posts

Showing posts from March, 2014

How to create a system image in Windows 7

Image
Creating a system image is the most neglected step when a user buys a computer.
But it’s quite important, so when the system slows down and formatting the hard drive is one of the best options.
System image will come into the picture.
How to launch or use Windows 7 to create a system image?
Press the Windows key, and on the search box type “backup”.
On the search result, click on “Backup and Restore” (check image below)

Control Panel will open, on upper left corner of the window.
Click “Create System Image”. (check image below)


System Image window will open and will prompt where to save the image.
Windows will automatically check the available options on the system; if an external drive is connected to the computer it will be included on the option.
Or you can opt to select DVD if you want the image to be on DVDs. (check image below)


Upon selecting where to save the backup click the “next” button.
I had selected the external hard disk. If the DVD is selected, the capacity of your da…

How to view word in full screen using VBA?

Image
To use VBA or enable macro on word is to set the Developer tab.
To enable developer tab, click on File then select options.
On Word options, click on “Customize Ribbon” then tick on “Developer” tab.
Please check screen shot below:








To start doing macro.
Click on Developer tab, click on “Macros”.
Type a macro name and click on create.














Upon clicking on create; the Visual Basic Window will open.
Under the Visual Basic Application window, expand or collapse the Project Tab and double click on “ThisDocument”.








ThisDocument should be clicked in order to choose the events available  for the document.
On the right pane, click on the drop down menu and select “Open”.
If the event OPEN is chosen, the macro will be executed or will run automatically when document is open.
So basically under the drop down, any event that is chosen is the option that will be executed by the macro.
Type this code below, under the Open Sub procedure.
ActiveWindow.View.FullScreen = True
To check whether the code runs pr…

How to put comments on Batch File, VBA, Java, PowerShell and Python

Image
Comment on any programming language is extremely helpful. It will ease the debugging process. And it will make the code or the function easy to read or remember on what the piece of code or function is doing. If the program runs for years and a new OS is release and the program runs into compatibility issues. And the next programmer who comes along and who knows it will be you again. If the program has comments then it will be easy to read the source code.

Batch File Comment REM - use to comment on batch file
REM This is a comment line on my batch file script

VBA Comment Single Line Comment ' - use single quote  to comment on VBA
'This is a commented Line

VB.Net Comment Single Line Comment ' - single quote  to comment on VB.Net
'This is a commented Line

AutoIT Comment Singe Line Comment ; - use semi-colon to comment on AutoIT
;This is a commented Line

Java Comment Sing Line comment // - use double forward slash to comment a single line in Java
// This is a Single line comm…

How to set Windows Task Scheduler

Image
How to run task scheduler even if the user is not logged on?
How to set task scheduler via command line?
Example below are two methods on how to set Task Scheduler.
1.How to use the Graphical User Interface or the GUI on how to set task scheduler even if the user is not logged on.
2. How to use command line and use "Schtasks" command to set a task schedule.
In Windows Server 2008 or Windows 7, to run task scheduler type “Task” on the search text box and on the search result click on “Task Scheduler”.
In Windows 2012 or Windows 8, press the windows start key and type “Task” the Task scheduler will appear on the upper left of the search result.
On Windows 2012 or Windows 8 once you are on the start page, when a key is press on the keyboard it will automatically search for any programs that match the keys that has been typed.
To set a Task Scheduler on Windows 2008 even if the user is not logged on, please follow instruction and screen shot below.
Screen shot below should be t…

Beginning PowerShell from Step 1 to Step 1

PowerShell is a cool feature that makes the life of System Administrator easier.

It makes life easier because it will automate processes or procedures.

When would you automate a process?

If you find yourself in a situation where you always keep repeating the same thing, it’s a good sign that you need to automate the process. Unless you really love doing it and you don’t get annoyed doing it all over again and again, day in and day out.

If there’s a need also to consolidate or do a clean-up of hundreds and thousands of files, automating the process should be a good option. Not only it makes the work easier and is done quickly. Automating the process is not prone to human error.

But you need to do some trial test of the script to make sure it works as you expected.

On this example will consolidate files on a particular folder and sort the files by year and automatically create a folder by year. And move the files to the folder based on its year.

This would be good, if you have log file…

Kill multiple processes in Windows

Image
Use command line to stop or kill a process automatically.
Or use command line to stop multiple processes using batch file script.
If you’re running an application and you just want to stop the process at a certain time killing the process via command line will be a good option.
If you are developing a program and still on the debugging process, scheduling the process to stop the program due to its memory leak issue or other good reasons could be a good idea to stop the process automatically after a certain period of time.
Taskkill.exe is a command line tool to stop or kill a process via command line.
Tasklist.exe can be used in conjunction with taskkill.exe to list the running processes.
To kill a process Taskkill can use a PID or the process name as an input parameter.
We take notepad.exe as an example.
To kill a process (notepad.exe), type this command below.
Taskkill /IM  "notepad.exe"
It will stop or kill all notepad.exe processes; if there are 3 or 5 notepad that are op…

Unable to install Teamviewer on Windows 7 and Windows 8

Installing Teamviewer on Windows 7 and Windows 8, has an error message of “rollback framework could not be initialized, installation aborted”.
To resolve this issue login to an administrator user account.
Go to an elevated command prompt and enable the hidden admin account.

Click on the link below, to check on how to open an elevated command prompt using Windows 7.

http://quickbytesstuff.blogspot.sg/2014/10/open-elevated-command-prompt.html


To open an elevated command prompt in Windows 10 check out link below:

http://quickbytesstuff.blogspot.sg/2015/08/quickly-access-command-prompt-or.html


Type:  net user administrator /active:yes
If the command prompt is not elevated you will receive this error:
System error 5 has occurred. Access is denied.
However if the command is successful, it will show:
The command completed successfully.

How to disable Excel autocomplete for cell values

Image
Disable autocomplete for cell values in Excel 2010.
If you find it annoying to have the autocomplete features in Excel, you can turn it off.
To turn it off is to click on the ribbon or go to “File”.
Click on “Options”.
Excel option window will pop-up.
Click the “Advanced” options.
Untick “Enable Autocomplete for cell Values”.


Check out this screen shot below:




Excel Macro run batch file

Need a VBA Macro to run or call a batch file?

Quick and easy way to call batch file via macro or VBA is to use the shell command.

Here's the example below:

Shell ("path to the batch file", window_style_paremeter)

Code snippet:

Shell ("d:\StopProcess,bat", vbHide)

Shell ("d:\StopProcess,bat", vbNormalFocus)