Move files into folders, sorted by month and day with PowerShell

Notes:

  • Not suitable for folder with sub-folders, such as folder of extracted zip file
  • Recommended to execute on a test environment first

Steps:

  1. Change the $files and $targetPath values accordingly
  2. Copy the modified script and paste into Windows PowerShell
  3. Wait

The script:

# Get the files which should be moved, without folders
$files = Get-ChildItem 'CHANGE THIS TO ORIGINAL PATH' -Recurse | where {!$_.PsIsContainer}

# List Files which will be moved
$files

# Target folder where files should be moved to. The script will automatically create a folder for the year and month.
$targetPath = 'CHANGE THIS TO TARGET PATH'

foreach ($file in $files)
{
# Get year and Month of the file
# I used LastWriteTime since this are synced files and the creation day will be the date when it was synced
$year = $file.LastWriteTime.Year.ToString()
$month = $file.LastWriteTime.Month.ToString()

# Out FileName, year and month
$file.Name
$year
$month

# Set Directory Path
$Directory = $targetPath + "" + $year + "" + $month
# Create directory if it doesn't exsist
if (!(Test-Path $Directory))
{
New-Item $directory -type directory
}

# Move File to new location
$file | Move-Item -Destination $Directory
}

Screenshots:

2016-11-09_11-51-24
Before (what a mess!)

2016-11-09_11-58-42

2016-11-09_12-10-37

2016-11-09_15-14-41
After

2016-11-09_12-16-26

Source:

 

Move files to folder sorted by year and month with PowerShell

Clipboard Manager? Ditto jadikan Copy Paste lebih mudah

Ditto Clipboard Manager, adalah satu aplikasi (free & open source) yang sangat bagus untuk pengguna OS Windows. Ianya memudahkan pengguna untuk manage atau menggunakan semula items yang disalin (copy) untuk digunakan (paste) semula, pada bila-bila masa. Ini kerana semua items (bergantung pada setting) yang disalin akan disimpan di dalam database.

Sebagai contoh, kita copy satu ayat atau paragraph dari satu website. Kemudian, pada esok hari atau bila-bila sahaja ianya boleh digunakan semula (paste). Tambahan pula, ianya lengkap dengan fungsi carian yang memudahkan lagi kita untuk mencari perkataan atau items yang kita salin.

Atau, mungkin kita ada salin banyak URL website, kalau tanpa Ditto setiap URL yang kita salin akan dihapuskan dengan items baru yang kita copy. Memang di browser kita ada bookmark, tapi haruskah kita buka browser setiap kali? Sedangkan kita nak paste bukan di browser?

Ishhh… macam susah nak explain… bacalah sendiri dia punya description ni hahaha!

Ditto is an extension to the standard windows clipboard. It saves each item placed on the clipboard allowing you access to any of those items at a later time. Ditto allows you to save any type of information that can be put on the clipboard, text, images, html, custom formats, …..

Some Features of Ditto Clipboard Manager

  • Easy to use interface
  • Search and paste previous copy entries
  • Keep multiple computer’s clipboards in sync
  • Data is encrypted when sent over the network
  • Accessed from tray icon or global hot key
  • Select entry by double click, enter key or drag drop
  • Paste into any window that excepts standard copy/paste entries
  • Display thumbnail of copied images in list
  • Full Unicode support(display foreign characters)
  • UTF-8 support for language files(create language files in any language)
  • Uses sqlite database (www.sqlite.org)

Anyway, Abah dah menggunakan tool ni agak lama. Compatible dengan Windows 7 — Windows 10. Walaupon terdapat banyak clipboard manager di internet, bagi Abah, Ditto Clipboard Manager adalah yang terbaek!

Boleh download Ditto di website ni: http://ditto-cp.sourceforge.net/

Clipboard Manager? Ditto jadikan Copy Paste lebih mudah

Ditto Clipboard Manager, adalah satu aplikasi (free & open source) yang sangat bagus untuk pengguna OS Windows. Ianya memudahkan pengguna untuk manage atau menggunakan semula items yang disalin (copy) untuk digunakan (paste) semula, pada bila-bila masa. Ini kerana semua items (bergantung pada setting) yang disalin akan disimpan di dalam database.

Sebagai contoh, kita copy satu ayat atau paragraph dari satu website. Kemudian, pada esok hari atau bila-bila sahaja ianya boleh digunakan semula (paste). Tambahan pula, ianya lengkap dengan fungsi carian yang memudahkan lagi kita untuk mencari perkataan atau items yang kita salin.

Atau, mungkin kita ada salin banyak URL website, kalau tanpa Ditto setiap URL yang kita salin akan dihapuskan dengan items baru yang kita copy. Memang di browser kita ada bookmark, tapi haruskah kita buka browser setiap kali? Sedangkan kita nak paste bukan di browser?

Ishhh… macam susah nak explain… bacalah sendiri dia punya description ni hahaha!

Ditto is an extension to the standard windows clipboard. It saves each item placed on the clipboard allowing you access to any of those items at a later time. Ditto allows you to save any type of information that can be put on the clipboard, text, images, html, custom formats, …..

Some Features of Ditto Clipboard Manager

  • Easy to use interface
  • Search and paste previous copy entries
  • Keep multiple computer’s clipboards in sync
  • Data is encrypted when sent over the network
  • Accessed from tray icon or global hot key
  • Select entry by double click, enter key or drag drop
  • Paste into any window that excepts standard copy/paste entries
  • Display thumbnail of copied images in list
  • Full Unicode support(display foreign characters)
  • UTF-8 support for language files(create language files in any language)
  • Uses sqlite database (www.sqlite.org)

Anyway, Abah dah menggunakan tool ni agak lama. Compatible dengan Windows 7 — Windows 10. Walaupon terdapat banyak clipboard manager di internet, bagi Abah, Ditto Clipboard Manager adalah yang terbaek!

Boleh download Ditto di website ni: http://ditto-cp.sourceforge.net/

F5 Networks Error: Network Access Connection Device not found

F5 Networks Error: Network Access Connection Device not found

OS: Windows 8 and higher

Browser: Firefox

Solution: Manually install the network driver

How To:

  1. Download this F5driver
  2. Open the Device Manager
  3. Look for F5 related device with error icon (exclamation mark)
  4. Right click on it, choose Update Driver Software
  5. Use the Have Disk option, choose “covpn2~1.inf” file from the saved F5driver folder

Side Notes:

  1. If the F5 plugin installation failed in Firefox, set the “xpinstall.signatures.required” value to “false” (in about:config)

Linking (faking) a folder into OneDrive

In my case, I have a folder (“2015” in Pictures) which in a different partition. Installed OneDrive app, and I don’t want to “move” the “2015” folder into “OneDrivePictures” as it will increase my C: drive usage.

So, here is how I did, basically it’s like “faking” a folder in “OneDrivePictures”

Syntax: mklink [[/d] | [/h] | [/j]] <Link> <Target>

Example:

Link — “C:UsersHilmanOneDrivePictures2015-link”

Target — “D:Pictures2015”

  1. Run a CMD as Administrator
  2. Type “mklink /j “C:UsersHilmanOneDrivePictures2015-link” “D:Pictures2015”
  3. A folder (fake) with name “2015-link” will be created in “C:UsersHilmanOneDrivePictures”, thus will be sync into OneDrive online — You may notice the folder will look like a shortcut icon

What happen then? Well, whenever I saved a photo into “2015-link” folder it will actually save it into “D:Pictures2015″… and vise versa. Of course, it will not increase my C: drive usage.

For more info about MKLINK parameters, click this.

Note(s):

  1. Do not create the folder in Link, instead create it in CMD prompt. Otherwise, an error will appears saying “Cannot create a file when that file already exists.