Skip to main content

Posts

Showing posts from October, 2015

WMIC Get IP Address

How to get IP Address via command line using WMIC? Get IP Address of   remote computer. Get IP Address using WMIC.       wmic nicconfig get IPAddress,ServiceName Sample output: IPAddress                                       ServiceName                                                 kdnic {"169.254.0.241", "fe80::26d0:eff6:cc27:e1"}    VBoxNetAdp {"192.168.11.6", "fe80::8798:acfe:6ee9:8b7c"}    athr                                                 L1C                                             ...

PowerShell Get IP Address and Subnet mask

 Get IP Address, MAC Address and Subnet mask. It also displays the CIDR (Classless InterDomain Routing) notation. Here's the script:  ====================================== $nic_configuration = gwmi -computer .  -class "win32_networkadapterconfiguration" | Where-Object {$_.defaultIPGateway -ne $null} $IP = $nic_configuration.ipaddress write-output " IP Address : $IP" $MAC_Address = $nic_configuration.MACAddress write-output " MAC Address :  $MAC_Address" $SubnetMask = $nic_configuration.ipsubnet switch ($SubnetMask) { 255.255.255.255   {" Subnet mask is: 255.255.255.255 or /32 "} 255.255.255.254   {" Subnet mask is: 255.255.255.254  or   /31 "} 255.255.255.252   {" Subnet mask is:  255.255.255.252 or   /30 "} 255.255.255.248   {" Subnet mask is: 255.255.255.248 or  /29 "} 255.255.255.240   {" Subnet mask is:   255.255.255.240   or   /28"} ...

Excel count non-empty cells or blank cells

Excel provides a function to check blank cells and also provide functions to check cells that are not empty. CountA function will check cells that are not empty. Countblank function as its name literally implies will check or count for blank or empty cells. Example for Countblank function: =COUNTBLANK(A1:B11) --- Function will check for empty spaces from A1 to B11 (2 columns) =COUNTBLANK((A1:A11)) --- Function will check for empty spaces in a single column. Note the double parentheses Example for CountA function: =COUNTA(A1:A11) --- Function to check cells with values in a single column (Column A only) =COUNTA(A1:B11)   --- Functio to check cells with values in two columns from A1 to B11 (Column A and B) To enter formula above using VBA: ============================== Sub VBA_Formula() Dim Cell_Formula As String Dim xvalue As String Cell_Formula = "=COUNTA(A1:A11)" 'Cell_Formula = "=COUNTBLANK((A1:A...

Check startup items in Windows

Startup items might slow down your computer during logon or boot up process and some malware or viruses can also be triggered using startup items in Windows registry. How to check startup items in Windows? If you want to have a  simple reminder upon startup the "run" item on the registry will be able to help. A reminder during Windows logon or startup can be set on the "run" key registry. Like running a notepad with notes on it, so every time the computer boots up the notepad will open and you can read whatever notes are written on the notepad. How to query the run item in Windows registry for programs that run automatically on startup? Of course, this can be done manually by opening the registry editor and browsing to the desired registry keys. Command line is useful to automate the process or query a remote computer without disturbing the user. Here's the link on how to query remote computers registry using command line: ...

Excel VBA autofill date range

How to auto fill a range of cells with date? To auto fill range of cells can be done via VBA or manually. To manually fill a range of cells with date. Type two dates on two cells and highlight the two cells and manually drag to the desired range of cells. Drag from the bottom right with the "+" sign on it. See screen shot below:            To do it via VBA is quite simple also using autofill function. Sub AutoFill_Dates()   Dim srcRange As Range   Dim destRange As Range   Set srcRange = ActiveSheet.Range("E1") 'E1 should have valid date value   Set destRange = ActiveSheet.Range("E1:E15") 'E1 to E15 will be filled with the dates (starting the date specified on E1)   srcRange.AutoFill destRange, xlFillSeries 'xlFillSeries will auto fill the dates in sequence End Sub Cheers.. Hope it helps..

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\ ...

Excel 2010 date difference

How to use datedif function in Excel? How to find date difference between two dates in Excel? How to find date difference by month, year or days in Excel? Excel has a built-in function and does the heavy lifting to date difference between two dates. Excel uses the “datedif” function to easily compute the date difference  by days, months or years. Notice the Datedif function has a single “f” at the end it’s not DateDiff. If you accidentally type double “f” at the end of the function excel will return an error and will just display “#NAME?” which basically means that the function is not recognized by Excel. Here’s the function: =DATEDIF(A1,C1,"d")  ==== > this function find the date difference by days for the values of A1 and C1 =DATEDIF(A3,C3,"m")  ==== > this function find the date difference by months for the values of A3 and C3 =DATEDIF(A5,C5,"y")  ==== > this function find the date difference by yea...

PowerShell get processor info

How to check if processor is 32bit or 64bit? How to check how many logical processors? How to get processor speed? How to check whether the server has more than one physical processor? PowerShell comes in handy to get processor information. PowerShell script below gets the number of cores, number of enabled cores, and number of logical processors, processor id and the manufacturer information of the processor. If the system has more than one physical processor PowerShell script below will get all the information of all the processor information installed on the system. I haven’t tested this one since my system has only one physical processor but believe PowerShell will list all the available physical processor on the system. Here’s the script: ============================================== $cpu_info = Get-WmiObject -class Win32_Processor foreach ( $cpu_values in $cpu_info ) { "Name " +[ char ] 9 +[ char ] 9 +[ char ] 9 ...