Thursday, August 6, 2015

How to get a list of folders only to be used in a batch file

I have been asked a few times "How do I get a list of folder names only to be used in a windows batch file?"

There a likely several ways to accomplish this depending on your intended use but for a simple list of folders found in a particular directory you can run the command below

dir /B /A:D-H-S

This command will display a list of folder names only without any time stamps or file sizes. It will not show Hidden or System folders.
This can be used if you wanted to loop through these folders in a batch file and perform another action on each folder.

The /B switch is for "bare format"
The /A:D-H-S shows only Directories (D) and does not show Hidden(-H) or System(-S) files

You can also pipe this to a text file if you wanted as well by using

dir /B /A:D-H-S > directory-listing.txt
To read more about the dir command options you can also type the following from a windows command prompt.

dir /?


Hope this helps.

Tuesday, August 4, 2015

How to install older version of Android apps

Ran into a problem with an automatic update on my Android phone (Galaxy S5)
An update caused the app to force close on every attempt to open it.

If this has happened to you you know how frustrating it can be if you have to wait for the developer to fix and update the app again.

If you can't wait there may be an option for you to save some sanity.

Please use this at your own risk.

Android app are sent to your phone in a formate called and APK file.

There is a site called APK Mirror http://www.apkmirror.com/ that has downloadable versions of many Android apps all sorted by date. It does not have every Android app but does have many of the most popular such as Facebook and Google Chrome etc...

Im my case I downloaded the prior version apk file of the app in question to my phone.

NOTE that you may need to change a setting on your phone that allows you to install apps from third parties.  As there are too many phone to give details on this you will have to search for specific instructions to enable this on your phone.  However many phone have this setting listed under SETTINGS then SECURITY.  Look for the checkbox for the setting.

Again please use this at your own risk but It Fixed it for me.

Monday, August 3, 2015

Two useful Linux commands

I came across a couple of Linux commands that I have not used before and wanted to share them in case anyone else find them useful. I used them to determin who was on a linux server as well as when the server last rebooted for troubleshooting a web server problem.

The command are 
last
From the man page:

NAME
       last, lastb - show listing of last logged in users

SYNOPSIS
       last  [-R] [-num] [ -n num ] [-adFiowx] [ -f file ] [ -t YYYYMMDDHHMMSS
       ] [name...]  [tty...]
       lastb [-R] [-num] [ -n num ] [ -f file ] [-adFiowx] [name...]  [tty...]

DESCRIPTION
       Last searches back through the file /var/log/wtmp (or the  file  desig‐
       nated  by  the -f flag) and displays a list of all users logged in (and
       out) since that file was created.  Names of  users  and  tty's  can  be
       given,  in  which  case  last will show only those entries matching the
       arguments.  Names of ttys can be abbreviated, thus last 0 is  the  same
       as last tty0.



The other is a variation of the first and shows a list of reboots on the pc or server.

last reboot
From the man page:
      The pseudo user reboot logs in each time the system is rebooted.   Thus
       last  reboot will show a log of all reboots since the log file was cre‐
       ated.



Hope this helps.


Friday, July 31, 2015

How do I include the date in a Windows Batch file?

I have used this many time in Windows batch files.

You can set any variable, in my example below called "thedate" to a substring of the computers date to produce only the numbers without any "/" in case this needs to be used in creating folder or file names.

For my example I would like to use a script to create a photos folder with the date in the name:

set thedate=%date:~-4,4%%date:~0,2%%date:~-7,2%

then you can show your output

echo %thedate%
 I then use

mkdir photos_%thedate%

to create a folder called "photos_20150727"














The above was created using Window 7.

Hope this help







Wednesday, July 29, 2015

How many innocent pc users fall for this trap?

Another not really new but new enough phone scam is going around. 
The companies and callers could sound very legitimate using all the correct buzz words but they are just tyring to fool you into giving them your credit card.

The scam goes like this.
  • You may get a call caliming to be from "Microsoft Support" or another Computer Tech Services company claiming that your pc is infected and they they need to connect to your pc to fix it. 
  • If you fall for this, the company will charge your credit card and then pretend to fix your computer. but in reality not do anything (or could even be infecting your pc further)
  • After a couple of days a second call may come alerting you that the first caller was a scam and that for an additional large sum of money they will clean up what the first scam company did.
  • They would then charge your credit card again.

You have now be scammed twice likely by the same company.

Most of these scams orginate from outside of the USA so there is little that anyone can do to prosecute these criminals


DO NOT FALL FOR THIS.
Always use uptodate Antivirus and Antimalware software.
For some of my recommended programs please see this link

I hope this prevents even one user from falling for this.

What is using all of my disk space?

What is using all of my disk space?

This is a question I get asked often. While the answer can vary greatly depending on what you do with your computer, the following app can show you in detail where the disk space is being used.


(screen shot from Jam-Software website)

TreeSize free (download from  https://www.jam-software.com/treesize_free/features.shtml ) is an application that can scan a disk or folder and display in order of space used the folders that are taking the most amount of space. It is less that 10MB is size itself so should install even the fullest hard drives.


While I do not recommend blindly deleting any files, this application may help you determine which folders to look at further.


I do not get any compensation from making this mini-review. This post simply intends to help users looking to free disk space.


Hope this helps.

Tuesday, July 28, 2015

Google Chromecast

I know there are many reviews for this out there already but whats one more :)

I recently picked up a Google Chromecast from Amazon. See the link below.
I believe I paid $35 for it. If you don't know what the Chromecast is, it is a small device that you can plug into an HDMI port on a TV and then "cast" content to it from various pc apps as well as phone  or tablet screens.




Personally I use this device to watch movies from a Plex Media server as well as Youtube play lists.

I have used this on vacation to watch content from my tablet as well.

For the price this can't be beat. Pick on up from the link above.


Monday, July 27, 2015

Useful Linux Command - with output redirection

This one has been around for a while but in case you have not come across (and in case I forget myself) here is another useful Linux command:

ls > textfile.txt

This is a simple way to get a list of files in a certain folder and rather than write them to the screen it writes them to a text file that could be used in another script perhaps.

The above command will create a simple list of the file names in a particular directory.

If would like more details on the files you can use

ls -l > textfile.txt

Added the  "-l" (the lowercase letter L) will produce a "long" list with the file details.

This could be used to create a spreadsheet where you could sort or filter the files for some other purpose.


Friday, July 24, 2015

Use SCONFIG in Windows Server 2012

There is a very simple command to help get a Windows 2012 server initially set up.
It is called the Server Configuration Tool and is started by running the command
sconfig
From Microsoft's site

"In Windows Server 2012, you can use the Server Configuration tool (Sconfig.cmd) to configure and manage several common aspects of Server Core installations. You must be a member of the Administrators group to use the tool.
Sconfig.cmd is available in the Minimal Server Interface and in Server with a GUI mode."



For those server admins that like the command line this is one worth trying.

Monday, February 18, 2013

How to make an RDP session full screen.

This one always bothers me and I never remember the key combo so I will post it here for myself as well as others.

This key combo will make an RDP session full screen. Once I open an Remote Desktop window and becomes "not full screen" it sometimes may not go back to full screen even though you maximize the window,

To make an RDP session window full screen again use the below key combo.

Ctrl+Alt+Break

Hope this helps.