diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 3e948d7..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,80 +0,0 @@
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-*$py.class
-
-# Distribution / packaging
-.Python
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-wheels/
-pip-wheel-metadata/
-share/python-wheels/
-*.egg-info/
-.installed.cfg
-*.egg
-MANIFEST
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.nox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*.cover
-*.py,cover
-.hypothesis/
-.pytest_cache/
-
-# Jupyter Notebook
-.ipynb_checkpoints
-
-# IPython
-profile_default/
-ipython_config.py
-
-# pyenv
-.python-version
-
-# PEP 582; used by e.g. github.com/David-OConnor/pyflow
-__pypackages__/
-
-# Environments
-.env
-.venv
-env/
-venv/
-ENV/
-env.bak/
-venv.bak/
-
-# mypy
-.mypy_cache/
-.dmypy.json
-dmypy.json
-
-# Pyre type checker
-.pyre/
-
-# custom
-.idea/
-
-# test artifacts
-/*.lnk
-/*.ini
diff --git a/LICENSE b/LICENSE
deleted file mode 100644
index 65c5ca8..0000000
--- a/LICENSE
+++ /dev/null
@@ -1,165 +0,0 @@
-                   GNU LESSER GENERAL PUBLIC LICENSE
-                       Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
-  This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-  0. Additional Definitions.
-
-  As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
-  "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
-  An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
-  A "Combined Work" is a work produced by combining or linking an
-Application with the Library.  The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
-  The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
-  The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-  1. Exception to Section 3 of the GNU GPL.
-
-  You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-  2. Conveying Modified Versions.
-
-  If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
-   a) under this License, provided that you make a good faith effort to
-   ensure that, in the event an Application does not supply the
-   function or data, the facility still operates, and performs
-   whatever part of its purpose remains meaningful, or
-
-   b) under the GNU GPL, with none of the additional permissions of
-   this License applicable to that copy.
-
-  3. Object Code Incorporating Material from Library Header Files.
-
-  The object code form of an Application may incorporate material from
-a header file that is part of the Library.  You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
-   a) Give prominent notice with each copy of the object code that the
-   Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the object code with a copy of the GNU GPL and this license
-   document.
-
-  4. Combined Works.
-
-  You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
-   a) Give prominent notice with each copy of the Combined Work that
-   the Library is used in it and that the Library and its use are
-   covered by this License.
-
-   b) Accompany the Combined Work with a copy of the GNU GPL and this license
-   document.
-
-   c) For a Combined Work that displays copyright notices during
-   execution, include the copyright notice for the Library among
-   these notices, as well as a reference directing the user to the
-   copies of the GNU GPL and this license document.
-
-   d) Do one of the following:
-
-       0) Convey the Minimal Corresponding Source under the terms of this
-       License, and the Corresponding Application Code in a form
-       suitable for, and under terms that permit, the user to
-       recombine or relink the Application with a modified version of
-       the Linked Version to produce a modified Combined Work, in the
-       manner specified by section 6 of the GNU GPL for conveying
-       Corresponding Source.
-
-       1) Use a suitable shared library mechanism for linking with the
-       Library.  A suitable mechanism is one that (a) uses at run time
-       a copy of the Library already present on the user's computer
-       system, and (b) will operate properly with a modified version
-       of the Library that is interface-compatible with the Linked
-       Version.
-
-   e) Provide Installation Information, but only if you would otherwise
-   be required to provide such information under section 6 of the
-   GNU GPL, and only to the extent that such information is
-   necessary to install and execute a modified version of the
-   Combined Work produced by recombining or relinking the
-   Application with a modified version of the Linked Version. (If
-   you use option 4d0, the Installation Information must accompany
-   the Minimal Corresponding Source and Corresponding Application
-   Code. If you use option 4d1, you must provide the Installation
-   Information in the manner specified by section 6 of the GNU GPL
-   for conveying Corresponding Source.)
-
-  5. Combined Libraries.
-
-  You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
-   a) Accompany the combined library with a copy of the same work based
-   on the Library, uncombined with any other library facilities,
-   conveyed under the terms of this License.
-
-   b) Give prominent notice with the combined library that part of it
-   is a work based on the Library, and explaining where to find the
-   accompanying uncombined form of the same work.
-
-  6. Revised Versions of the GNU Lesser General Public License.
-
-  The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-  Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
-  If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..1f931eb
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,119 @@
+Metadata-Version: 2.1
+Name: pylnk3
+Version: 0.4.2
+Summary: Windows LNK File Parser and Creator
+Home-page: https://github.com/strayge/pylnk
+Author: strayge
+Author-email: strayge@gmail.com
+License: GNU Library or Lesser General Public License (LGPL)
+Description: # PyLnk 3
+        
+        [![PyPI version shields.io](https://img.shields.io/pypi/v/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        [![PyPI pyversions](https://img.shields.io/pypi/pyversions/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        [![PyPI download month](https://img.shields.io/pypi/dm/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        
+        Python library for reading and writing Windows shortcut files (.lnk).  
+        Converted to support python 3.
+        
+        This library can parse .lnk files and extract all relevant information from
+        them. Parsing a .lnk file yields a LNK object which can be altered and saved
+        again. Moreover, .lnk file can be created from scratch be creating a LNK
+        object, populating it with data and then saving it to a file. As that
+        process requires some knowledge about the internals of .lnk files, some
+        convenience functions are provided.
+        
+        Limitation: Windows knows lots of different types of shortcuts which all have
+        different formats. This library currently only supports shortcuts to files and
+        folders on the local machine. 
+        
+        ## CLI
+        
+        Mainly tool has two basic commands.
+        
+        #### Parse existed lnk file
+        
+        ```sh
+        pylnk3 parse [-h] filename [props [props ...]]
+        
+        positional arguments:
+          filename    lnk filename to read
+          props       props path to read
+        
+        optional arguments:
+          -h, --help  show this help message and exit
+        ```
+        
+        #### Create new lnk file
+        
+        ```sh
+        usage: pylnk3 create [-h] [--arguments [ARGUMENTS]] [--description [DESCRIPTION]] [--icon [ICON]]
+                             [--icon-index [ICON_INDEX]] [--workdir [WORKDIR]] [--mode [{Maximized,Normal,Minimized}]]
+                             target name
+        
+        positional arguments:
+          target                target path
+          name                  lnk filename to create
+        
+        optional arguments:
+          -h, --help            show this help message and exit
+          --arguments [ARGUMENTS], -a [ARGUMENTS]
+                                additional arguments
+          --description [DESCRIPTION], -d [DESCRIPTION]
+                                description
+          --icon [ICON], -i [ICON]
+                                icon filename
+          --icon-index [ICON_INDEX], -ii [ICON_INDEX]
+                                icon index
+          --workdir [WORKDIR], -w [WORKDIR]
+                                working directory
+          --mode [{Maximized,Normal,Minimized}], -m [{Maximized,Normal,Minimized}]
+                                window mode
+        ```
+        
+        #### Examples
+        ```sh
+        pylnk3 p filename.lnk
+        pylnk3 c c:\prog.exe shortcut.lnk
+        pylnk3 c \\192.168.1.1\share\file.doc doc.lnk
+        pylnk3 create c:\1.txt text.lnk -m Minimized -d "Description"
+        ```
+        
+        ## Changes
+        
+        **0.4.2**  
+        changed logic for Lnk.path choose (in case of different paths presents at different structures)  
+        read links with root as GUID of KNOWN_FOLDER  
+        [FIX] disabled padding for writing LinkInfo.local_base_path  
+        
+        **0.4.0**  
+        added support for network links  
+        reworked CLI (added more options for creating links)  
+        added entry point for call tool just like `pylnk3`  
+        [FIX] allow build links for non-existed (from this machine) paths  
+        [FIX] correct building links on Linux (now expect Windows-like path)  
+        [FIX] fixed path priority at parsing with both local & remote presents  
+        
+        
+        **0.3.0**  
+        added support links to UWP apps  
+        
+        
+        **0.2.1**  
+        released to PyPI
+        
+          
+        **0.2.0**  
+        converted to python 3  
+        
+Keywords: lnk,shortcut,windows
+Platform: UNKNOWN
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
+Classifier: Operating System :: OS Independent
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=3.6
+Description-Content-Type: text/markdown
diff --git a/README.md b/README.md
index fd7f23e..57ab4c1 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,8 @@
-# PyLink3
+# PyLnk 3
+
+[![PyPI version shields.io](https://img.shields.io/pypi/v/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+[![PyPI pyversions](https://img.shields.io/pypi/pyversions/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+[![PyPI download month](https://img.shields.io/pypi/dm/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
 
 Python library for reading and writing Windows shortcut files (.lnk).  
 Converted to support python 3.
@@ -13,3 +17,82 @@ convenience functions are provided.
 Limitation: Windows knows lots of different types of shortcuts which all have
 different formats. This library currently only supports shortcuts to files and
 folders on the local machine. 
+
+## CLI
+
+Mainly tool has two basic commands.
+
+#### Parse existed lnk file
+
+```sh
+pylnk3 parse [-h] filename [props [props ...]]
+
+positional arguments:
+  filename    lnk filename to read
+  props       props path to read
+
+optional arguments:
+  -h, --help  show this help message and exit
+```
+
+#### Create new lnk file
+
+```sh
+usage: pylnk3 create [-h] [--arguments [ARGUMENTS]] [--description [DESCRIPTION]] [--icon [ICON]]
+                     [--icon-index [ICON_INDEX]] [--workdir [WORKDIR]] [--mode [{Maximized,Normal,Minimized}]]
+                     target name
+
+positional arguments:
+  target                target path
+  name                  lnk filename to create
+
+optional arguments:
+  -h, --help            show this help message and exit
+  --arguments [ARGUMENTS], -a [ARGUMENTS]
+                        additional arguments
+  --description [DESCRIPTION], -d [DESCRIPTION]
+                        description
+  --icon [ICON], -i [ICON]
+                        icon filename
+  --icon-index [ICON_INDEX], -ii [ICON_INDEX]
+                        icon index
+  --workdir [WORKDIR], -w [WORKDIR]
+                        working directory
+  --mode [{Maximized,Normal,Minimized}], -m [{Maximized,Normal,Minimized}]
+                        window mode
+```
+
+#### Examples
+```sh
+pylnk3 p filename.lnk
+pylnk3 c c:\prog.exe shortcut.lnk
+pylnk3 c \\192.168.1.1\share\file.doc doc.lnk
+pylnk3 create c:\1.txt text.lnk -m Minimized -d "Description"
+```
+
+## Changes
+
+**0.4.2**  
+changed logic for Lnk.path choose (in case of different paths presents at different structures)  
+read links with root as GUID of KNOWN_FOLDER  
+[FIX] disabled padding for writing LinkInfo.local_base_path  
+
+**0.4.0**  
+added support for network links  
+reworked CLI (added more options for creating links)  
+added entry point for call tool just like `pylnk3`  
+[FIX] allow build links for non-existed (from this machine) paths  
+[FIX] correct building links on Linux (now expect Windows-like path)  
+[FIX] fixed path priority at parsing with both local & remote presents  
+
+
+**0.3.0**  
+added support links to UWP apps  
+
+
+**0.2.1**  
+released to PyPI
+
+  
+**0.2.0**  
+converted to python 3  
diff --git a/debian/changelog b/debian/changelog
index 7a33558..411bc7a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+pylnk (0.4.2-0kali1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- Kali Janitor <janitor@kali.org>  Mon, 26 Apr 2021 00:41:27 -0000
+
 pylnk (0.2.1+git20200104-0kali1) kali-dev; urgency=medium
 
   * Initial release
diff --git a/pylnk3.egg-info/PKG-INFO b/pylnk3.egg-info/PKG-INFO
new file mode 100644
index 0000000..1f931eb
--- /dev/null
+++ b/pylnk3.egg-info/PKG-INFO
@@ -0,0 +1,119 @@
+Metadata-Version: 2.1
+Name: pylnk3
+Version: 0.4.2
+Summary: Windows LNK File Parser and Creator
+Home-page: https://github.com/strayge/pylnk
+Author: strayge
+Author-email: strayge@gmail.com
+License: GNU Library or Lesser General Public License (LGPL)
+Description: # PyLnk 3
+        
+        [![PyPI version shields.io](https://img.shields.io/pypi/v/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        [![PyPI pyversions](https://img.shields.io/pypi/pyversions/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        [![PyPI download month](https://img.shields.io/pypi/dm/pylnk3.svg)](https://pypi.python.org/pypi/pylnk3/)
+        
+        Python library for reading and writing Windows shortcut files (.lnk).  
+        Converted to support python 3.
+        
+        This library can parse .lnk files and extract all relevant information from
+        them. Parsing a .lnk file yields a LNK object which can be altered and saved
+        again. Moreover, .lnk file can be created from scratch be creating a LNK
+        object, populating it with data and then saving it to a file. As that
+        process requires some knowledge about the internals of .lnk files, some
+        convenience functions are provided.
+        
+        Limitation: Windows knows lots of different types of shortcuts which all have
+        different formats. This library currently only supports shortcuts to files and
+        folders on the local machine. 
+        
+        ## CLI
+        
+        Mainly tool has two basic commands.
+        
+        #### Parse existed lnk file
+        
+        ```sh
+        pylnk3 parse [-h] filename [props [props ...]]
+        
+        positional arguments:
+          filename    lnk filename to read
+          props       props path to read
+        
+        optional arguments:
+          -h, --help  show this help message and exit
+        ```
+        
+        #### Create new lnk file
+        
+        ```sh
+        usage: pylnk3 create [-h] [--arguments [ARGUMENTS]] [--description [DESCRIPTION]] [--icon [ICON]]
+                             [--icon-index [ICON_INDEX]] [--workdir [WORKDIR]] [--mode [{Maximized,Normal,Minimized}]]
+                             target name
+        
+        positional arguments:
+          target                target path
+          name                  lnk filename to create
+        
+        optional arguments:
+          -h, --help            show this help message and exit
+          --arguments [ARGUMENTS], -a [ARGUMENTS]
+                                additional arguments
+          --description [DESCRIPTION], -d [DESCRIPTION]
+                                description
+          --icon [ICON], -i [ICON]
+                                icon filename
+          --icon-index [ICON_INDEX], -ii [ICON_INDEX]
+                                icon index
+          --workdir [WORKDIR], -w [WORKDIR]
+                                working directory
+          --mode [{Maximized,Normal,Minimized}], -m [{Maximized,Normal,Minimized}]
+                                window mode
+        ```
+        
+        #### Examples
+        ```sh
+        pylnk3 p filename.lnk
+        pylnk3 c c:\prog.exe shortcut.lnk
+        pylnk3 c \\192.168.1.1\share\file.doc doc.lnk
+        pylnk3 create c:\1.txt text.lnk -m Minimized -d "Description"
+        ```
+        
+        ## Changes
+        
+        **0.4.2**  
+        changed logic for Lnk.path choose (in case of different paths presents at different structures)  
+        read links with root as GUID of KNOWN_FOLDER  
+        [FIX] disabled padding for writing LinkInfo.local_base_path  
+        
+        **0.4.0**  
+        added support for network links  
+        reworked CLI (added more options for creating links)  
+        added entry point for call tool just like `pylnk3`  
+        [FIX] allow build links for non-existed (from this machine) paths  
+        [FIX] correct building links on Linux (now expect Windows-like path)  
+        [FIX] fixed path priority at parsing with both local & remote presents  
+        
+        
+        **0.3.0**  
+        added support links to UWP apps  
+        
+        
+        **0.2.1**  
+        released to PyPI
+        
+          
+        **0.2.0**  
+        converted to python 3  
+        
+Keywords: lnk,shortcut,windows
+Platform: UNKNOWN
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
+Classifier: Operating System :: OS Independent
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=3.6
+Description-Content-Type: text/markdown
diff --git a/pylnk3.egg-info/SOURCES.txt b/pylnk3.egg-info/SOURCES.txt
new file mode 100644
index 0000000..169231c
--- /dev/null
+++ b/pylnk3.egg-info/SOURCES.txt
@@ -0,0 +1,8 @@
+README.md
+pylnk3.py
+setup.py
+pylnk3.egg-info/PKG-INFO
+pylnk3.egg-info/SOURCES.txt
+pylnk3.egg-info/dependency_links.txt
+pylnk3.egg-info/entry_points.txt
+pylnk3.egg-info/top_level.txt
\ No newline at end of file
diff --git a/pylnk3.egg-info/dependency_links.txt b/pylnk3.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/pylnk3.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/pylnk3.egg-info/entry_points.txt b/pylnk3.egg-info/entry_points.txt
new file mode 100644
index 0000000..302c02c
--- /dev/null
+++ b/pylnk3.egg-info/entry_points.txt
@@ -0,0 +1,3 @@
+[console_scripts]
+pylnk3 = pylnk3:cli
+
diff --git a/pylnk3.egg-info/top_level.txt b/pylnk3.egg-info/top_level.txt
new file mode 100644
index 0000000..77454c7
--- /dev/null
+++ b/pylnk3.egg-info/top_level.txt
@@ -0,0 +1 @@
+pylnk3
diff --git a/pylnk.py b/pylnk3.py
similarity index 86%
rename from pylnk.py
rename to pylnk3.py
index 3e05424..376e37d 100644
--- a/pylnk.py
+++ b/pylnk3.py
@@ -5,16 +5,16 @@
 
 # converted to python3 by strayge:
 # https://github.com/strayge/pylnk
-
+import argparse
+import ntpath
 import os
 import re
-import sys
 import time
 from datetime import datetime
 from io import BytesIO, IOBase
 from pprint import pformat
 from struct import pack, unpack
-from typing import Optional, Union, Tuple, Dict
+from typing import Dict, Optional, Tuple, Union
 
 DEFAULT_CHARSET = 'cp1251'
 
@@ -132,10 +132,12 @@ _ROOT_LOCATION_GUIDS = dict((v, k) for k, v in _ROOT_LOCATIONS.items())
 TYPE_FOLDER = 'FOLDER'
 TYPE_FILE = 'FILE'
 _ENTRY_TYPES = {
+    0x00: 'KNOWN_FOLDER',
     0x31: 'FOLDER',
     0x32: 'FILE',
     0x35: 'FOLDER (UNICODE)',
     0x36: 'FILE (UNICODE)',
+    0x802E: 'ROOT_KNOWN_FOLDER',
     # founded in doc, not tested
     0x1f: 'ROOT_FOLDER',
     0x61: 'URI',
@@ -355,7 +357,7 @@ def is_lnk(f):
 
 
 def path_levels(p):
-    dirname, base = os.path.split(p)
+    dirname, base = ntpath.split(p)
     if base != '':
         for level in path_levels(dirname):
             yield level
@@ -522,6 +524,28 @@ class PathSegmentEntry(object):
         buf = BytesIO(bytes)
         self.type = _ENTRY_TYPES.get(read_short(buf), 'UNKNOWN')
         short_name_is_unicode = self.type.endswith('(UNICODE)')
+
+        if self.type == 'ROOT_KNOWN_FOLDER':
+            self.full_name = '::' + guid_from_bytes(buf.read(16))
+            # then followed Beef0026 structure:
+            # short size
+            # short version
+            # int signature == 0xBEEF0026
+            # (16 bytes) created timestamp
+            # (16 bytes) modified timestamp
+            # (16 bytes) accessed timestamp
+            return
+
+        if self.type == 'KNOWN_FOLDER':
+            _ = read_short(buf)  # extra block size
+            extra_signature = read_int(buf)
+            if extra_signature == 0x23FEBBEE:
+                _ = read_short(buf)  # unknown
+                _ = read_short(buf)  # guid len
+                # that format recognized by explorer
+                self.full_name = '::' + guid_from_bytes(buf.read(16))
+            return
+
         self.file_size = read_int(buf)
         self.modified = read_dos_datetime(buf)
         unknown = read_short(buf)  # FileAttributesL
@@ -565,12 +589,19 @@ class PathSegmentEntry(object):
     def create_for_path(cls, path):
         entry = cls()
         entry.type = os.path.isdir(path) and TYPE_FOLDER or TYPE_FILE
-        st = os.stat(path)
-        entry.file_size = st.st_size
-        entry.modified = datetime.fromtimestamp(st.st_mtime)
-        entry.short_name = os.path.split(path)[1]
-        entry.created = datetime.fromtimestamp(st.st_ctime)
-        entry.accessed = datetime.fromtimestamp(st.st_atime)
+        try:
+            st = os.stat(path)
+            entry.file_size = st.st_size
+            entry.modified = datetime.fromtimestamp(st.st_mtime)
+            entry.created = datetime.fromtimestamp(st.st_ctime)
+            entry.accessed = datetime.fromtimestamp(st.st_atime)
+        except FileNotFoundError:
+            now = datetime.now()
+            entry.file_size = 0
+            entry.modified = now
+            entry.created = now
+            entry.accessed = now
+        entry.short_name = ntpath.split(path)[1]
         entry.full_name = entry.short_name
         return entry
 
@@ -578,7 +609,7 @@ class PathSegmentEntry(object):
         if self.type is None:
             raise MissingInformationException("Type is missing, choose either TYPE_FOLDER or TYPE_FILE.")
         if self.file_size is None:
-            if self.type.startswith('FOLDER'):
+            if self.type.startswith('FOLDER') or self.type in ['KNOWN_FOLDER', 'ROOT_KNOWN_FOLDER']:
                 self.file_size = 0
             else:
                 raise MissingInformationException("File size missing")
@@ -602,6 +633,29 @@ class PathSegmentEntry(object):
         self._validate()
         out = BytesIO()
         entry_type = self.type
+
+        if entry_type == 'KNOWN_FOLDER':
+            write_short(_ENTRY_TYPE_IDS[entry_type], out)
+            write_short(0x1A, out)  # size
+            write_int(0x23FEBBEE, out)  # extra signature
+            write_short(0x00, out)  # extra signature
+            write_short(0x10, out)  # guid size
+            out.write(bytes_from_guid(self.full_name.strip(':')))
+            return out.getvalue()
+
+        if entry_type == 'ROOT_KNOWN_FOLDER':
+            write_short(_ENTRY_TYPE_IDS[entry_type], out)
+            out.write(bytes_from_guid(self.full_name.strip(':')))
+            write_short(0x26, out)  # 0xBEEF0026 structure size
+            write_short(0x01, out)  # version
+            write_int(0xBEEF0026, out)  # extra signature
+            write_int(0x11, out)  # some flag for containing datetime
+            write_double(0x00, out)  # created datetime
+            write_double(0x00, out)  # modified datetime
+            write_double(0x00, out)  # accessed datetime
+            write_short(0x14, out)  # unknown
+            return out.getvalue()
+
         short_name_len = len(self.short_name) + 1
         try:
             self.short_name.encode("ascii")
@@ -850,13 +904,15 @@ class LinkTargetIDList(object):
             self._interpret(raw)
     
     def _interpret(self, raw):
-        # if len(raw[0]) == 0x12:
         if raw[0][0] == 0x1F:
             self.items.append(RootEntry(raw[0]))
             if self.items[0].root == ROOT_MY_COMPUTER:
-                if not len(raw[1]) == 0x17:
+                if len(raw[1]) == 0x17:
+                    self.items.append(DriveEntry(raw[1]))
+                elif raw[1][0:2] == b'\x2E\x80':  # ROOT_KNOWN_FOLDER
+                    self.items.append(PathSegmentEntry(raw[1]))
+                else:
                     raise ValueError("This seems to be an absolute link which requires a drive as second element.")
-                self.items.append(DriveEntry(raw[1]))
                 items = raw[2:]
             elif self.items[0].root == ROOT_NETWORK_PLACES:
                 raise NotImplementedError(
@@ -888,9 +944,12 @@ class LinkTargetIDList(object):
         return '\\'.join(segments)
     
     def _validate(self):
-        if type(self.items[0]) == RootEntry:
-            if self.items[0].root == ROOT_MY_COMPUTER and type(self.items[1]) != DriveEntry:
-                raise ValueError("A drive is required for absolute lnks")
+        if type(self.items[0]) == RootEntry and self.items[0].root == ROOT_MY_COMPUTER:
+            if type(self.items[1]) == DriveEntry:
+                return
+            if type(self.items[1]) == PathSegmentEntry and self.items[1].full_name.startswith('::'):
+                return
+            raise ValueError("A drive is required for absolute lnks")
 
     @property
     def bytes(self):
@@ -933,7 +992,8 @@ class LinkInfo(object):
         else:
             self.size = None
             self.header_size = _LINK_INFO_HEADER_DEFAULT
-            self.remote = None
+            self.local = 0
+            self.remote = 0
             self.offs_local_volume_table = 0
             self.offs_local_base_path = 0
             self.offs_network_volume_table = 0
@@ -966,7 +1026,7 @@ class LinkInfo(object):
 
     def make_path(self):
         if self.remote:
-            self._path = self.network_share_name + self.base_name
+            self._path = self.network_share_name + '\\' + self.base_name
         if self.local:
             self._path = self.local_base_path
     
@@ -984,17 +1044,17 @@ class LinkInfo(object):
         write_int(self.offs_base_name, lnk)
         if self.remote:
             self._write_network_volume_table(lnk)
-            write_cstring(self.base_name, lnk)
+            write_cstring(self.base_name, lnk, padding=False)
         else:
             self._write_local_volume_table(lnk)
-            write_cstring(self.local_base_path, lnk, padding=True)
-        write_byte(0, lnk)
+            write_cstring(self.local_base_path, lnk, padding=False)
+            write_byte(0, lnk)
     
     def _calculate_sizes_and_offsets(self):
         self.size_base_name = 1  # len(self.base_name) + 1  # zero terminated strings
         self.size = 28 + self.size_base_name
         if self.remote:
-            self.size_network_volume_table = 20 + len(self.network_share_name) + 1
+            self.size_network_volume_table = 20 + len(self.network_share_name) + len(self.base_name) + 1
             self.size += self.size_network_volume_table
             self.offs_local_volume_table = 0
             self.offs_local_base_path = 0
@@ -1060,6 +1120,7 @@ EXTRA_DATA_TYPES = {
     0xA0000008: 'ShimDataBlock',  # size >= 0x00000088
     0xA0000005: 'SpecialFolderDataBlock',  # size 0x00000010
     0xA0000003: 'VistaAndAboveIDListDataBlock',  # size 0x00000060
+    0xA000000C: 'VistaIDListDataBlock',  # size 0x00000173
 }
 
 
@@ -1626,7 +1687,33 @@ class Lnk(object):
 
     @property
     def path(self):
-        return self._shell_item_id_list.get_path()
+        # lnk can contains several different paths at different structures
+        # here is some logic consistent with link properties at explorer (at least on test examples)
+
+        link_info_path = self._link_info.path if self._link_info and self._link_info.path else None
+        id_list_path = self._shell_item_id_list.get_path() if hasattr(self, '_shell_item_id_list') else None
+
+        env_var_path = None
+        if self.extra_data and self.extra_data.blocks:
+            for block in self.extra_data.blocks:
+                if type(block) == ExtraData_EnvironmentVariableDataBlock:
+                    env_var_path = block.target_unicode.strip('\x00') or block.target_ansi.strip('\x00')
+                    break
+
+        if id_list_path and id_list_path.startswith('%MY_COMPUTER%'):
+            # full local path has priority
+            return id_list_path[14:]
+        if id_list_path and id_list_path.startswith('%USERPROFILE%\\::'):
+            # path to KNOWN_FOLDER also has priority over link_info
+            return id_list_path[14:]
+        if link_info_path:
+            # local path at link_info_path has priority over network path at id_list_path
+            # full local path at link_info_path has priority over partial path at id_list_path
+            return link_info_path
+        if env_var_path:
+            # some links in Recent folder contains path only at ExtraData_EnvironmentVariableDataBlock
+            return env_var_path
+        return id_list_path
 
     def specify_local_location(self, path, drive_type=None, drive_serial=None, volume_label=None):
         self._link_info.drive_type = drive_type or DRIVE_UNKNOWN
@@ -1664,8 +1751,8 @@ class Lnk(object):
             s += "\nCommandline Arguments: %s" % self.arguments
         if self.link_flags.HasIconLocation:
             s += "\nIcon: %s" % self.icon
-        if self.link_flags.HasLinkInfo:
-            s += "\nUsed Path: %s" % self.shell_item_id_list.get_path()
+        if self._link_info:
+            s += "\nUsed Path: %s" % self.path
         if self.extra_data:
             s += str(self.extra_data)
         return s
@@ -1683,32 +1770,54 @@ def create(f=None):
     return lnk
 
 
-def for_file(target_file, lnk_name=None, arguments=None, description=None, icon_file=None, icon_index=0, work_dir=None):
+def for_file(
+    target_file, lnk_name=None, arguments=None, description=None, icon_file=None, icon_index=0,
+    work_dir=None, window_mode=None,
+):
     lnk = create(lnk_name)
-    lnk.link_flags._flags['IsUnicode'] = True
+    lnk.link_flags.IsUnicode = True
     lnk.link_info = None
-    levels = list(path_levels(target_file))
-    elements = [RootEntry(ROOT_MY_COMPUTER),
-                DriveEntry(levels[0])]
-    for level in levels[1:]:
-        segment = PathSegmentEntry.create_for_path(level)
-        elements.append(segment)
-    lnk.shell_item_id_list = LinkTargetIDList()
-    lnk.shell_item_id_list.items = elements
-    # lnk.link_flags._flags['HasLinkInfo'] = True
+    if target_file.startswith('\\\\'):
+        # remote link
+        lnk.link_info = LinkInfo()
+        lnk.link_info.remote = 1
+        # extract server + share name from full path
+        path_parts = target_file.split('\\')
+        share_name, base_name = '\\'.join(path_parts[:4]), '\\'.join(path_parts[4:])
+        lnk.link_info.network_share_name = share_name.upper()
+        lnk.link_info.base_name = base_name
+        # somehow it requires EnvironmentVariableDataBlock & HasExpString flag
+        env_data_block = ExtraData_EnvironmentVariableDataBlock()
+        env_data_block.target_ansi = target_file
+        env_data_block.target_unicode = target_file
+        lnk.extra_data = ExtraData(blocks=[env_data_block])
+        lnk.link_flags.HasExpString = True
+    else:
+        # local link
+        levels = list(path_levels(target_file))
+        elements = [RootEntry(ROOT_MY_COMPUTER),
+                    DriveEntry(levels[0])]
+        for level in levels[1:]:
+            segment = PathSegmentEntry.create_for_path(level)
+            elements.append(segment)
+        lnk.shell_item_id_list = LinkTargetIDList()
+        lnk.shell_item_id_list.items = elements
+    # lnk.link_flags.HasLinkInfo = True
     if arguments:
-        lnk.link_flags._flags['HasArguments'] = True
+        lnk.link_flags.HasArguments = True
         lnk.arguments = arguments
     if description:
-        lnk.link_flags._flags['HasName'] = True
+        lnk.link_flags.HasName = True
         lnk.description = description
     if icon_file:
-        lnk.link_flags._flags['HasIconLocation'] = True
+        lnk.link_flags.HasIconLocation = True
         lnk.icon = icon_file
     lnk.icon_index = icon_index
     if work_dir:
-        lnk.link_flags._flags['HasWorkingDir'] = True
+        lnk.link_flags.HasWorkingDir = True
         lnk.work_dir = work_dir
+    if window_mode:
+        lnk.window_mode = window_mode
     if lnk_name:
         lnk.save()
     return lnk
@@ -1785,9 +1894,9 @@ def build_uwp(
     :param logo44x44:           ex.: Assets\\CalculatorAppList.png
     """
     lnk = Lnk()
-    lnk.link_flags._flags['HasLinkTargetIDList'] = True
-    lnk.link_flags._flags['IsUnicode'] = True
-    lnk.link_flags._flags['EnableTargetMetadata'] = True
+    lnk.link_flags.HasLinkTargetIDList = True
+    lnk.link_flags.IsUnicode = True
+    lnk.link_flags.EnableTargetMetadata = True
 
     lnk.shell_item_id_list = LinkTargetIDList()
 
@@ -1815,48 +1924,68 @@ def get_prop(obj, prop_queue):
     return attr
 
 
-def usage_and_exit():
-    usage = """usage: pylnk.py c[reate] TARGETFILE LNKFILE
-       pylnk.py p[arse] LNKFILE [PROPERTY[, PROPERTY[, ...]]]"""
-    print(usage)
-    sys.exit(1)
-
-
-if __name__ == "__main__":
-    # lnk = parse('temp_1.lnk.q')
-    # print(lnk)
-    # lnk.save('result.lnk.1')
-    # lnk = parse('result.lnk.1')
-    # print(lnk)
-    # exit(0)
-
-    if len(sys.argv) == 1:
-        usage_and_exit()
-    if sys.argv[1] in ['h', '-h', '--help']:
-        usage_and_exit()
-    action = sys.argv[1]
-    if action not in ['c', 'create', 'p', 'parse', 'd']:
-        print("unknown action: " + action)
-        usage_and_exit()
-    if action.startswith('c'):
-        if len(sys.argv) < 4:
-            usage_and_exit()
-        for_file(sys.argv[2], sys.argv[3])
-    elif action.startswith('p'):
-        if len(sys.argv) < 3:
-            usage_and_exit()
-        lnk = parse(sys.argv[2])
-        props = sys.argv[3:]
+def cli():
+    parser = argparse.ArgumentParser(add_help=False)
+    subparsers = parser.add_subparsers(dest='action', metavar='{p, c, d}')
+    parser.add_argument('--help', '-h', action='store_true')
+
+    parser_parse = subparsers.add_parser('parse', aliases=['p'], help='read lnk file')
+    parser_parse.add_argument('filename', help='lnk filename to read')
+    parser_parse.add_argument('props', nargs='*', help='props path to read')
+
+    parser_create = subparsers.add_parser('create', aliases=['c'], help='create new lnk file')
+    parser_create.add_argument('target', help='target path')
+    parser_create.add_argument('name', help='lnk filename to create')
+    parser_create.add_argument('--arguments', '-a', nargs='?', help='additional arguments')
+    parser_create.add_argument('--description', '-d', nargs='?', help='description')
+    parser_create.add_argument('--icon', '-i', nargs='?', help='icon filename')
+    parser_create.add_argument('--icon-index', '-ii', type=int, default=0, nargs='?', help='icon index')
+    parser_create.add_argument('--workdir', '-w', nargs='?', help='working directory')
+    parser_create.add_argument('--mode', '-m', nargs='?', choices=['Maximized', 'Normal', 'Minimized'], help='window mode')
+
+    parser_dup = subparsers.add_parser('duplicate', aliases=['d'], help='read and write lnk file')
+    parser_dup.add_argument('filename', help='lnk filename to read')
+    parser_dup.add_argument('new_filename', help='new filename to write')
+
+    args = parser.parse_args()
+    if args.help or not args.action:
+        print('''
+Tool for read or create .lnk files
+
+usage: pylnk3.py [p]arse / [c]reate ...
+
+Examples:
+pylnk3 p filename.lnk
+pylnk3 c c:\\prog.exe shortcut.lnk
+pylnk3 c \\\\192.168.1.1\\share\\file.doc doc.lnk
+pylnk3 create c:\\1.txt text.lnk -m Minimized -d "Description"
+
+for more info use help for each action (ex.: "pylnk3 create -h")
+        '''.strip())
+        exit(1)
+
+    if args.action in ['create', 'c']:
+        for_file(
+            args.target, args.name, arguments=args.arguments,
+            description=args.description, icon_file=args.icon,
+            icon_index=args.icon_index, work_dir=args.workdir,
+            window_mode=args.mode,
+        )
+    elif args.action in ['parse', 'p']:
+        lnk = parse(args.filename)
+        props = args.props
         if len(props) == 0:
             print(lnk)
         else:
             for prop in props:
                 print(get_prop(lnk, prop.split('.')))
-    elif action.startswith('d'):
-        if len(sys.argv) < 3:
-            usage_and_exit()
-        lnk = parse(sys.argv[2])
-        new_filename = sys.argv[3]
+    elif args.action in ['d', 'duplicate']:
+        lnk = parse(args.filename)
+        new_filename = args.new_filename
         print(lnk)
         lnk.save(new_filename)
         print('saved')
+
+
+if __name__ == '__main__':
+    cli()
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..4927abe
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,4 @@
+[egg_info]
+tag_build = 
+tag_date = 0
+
diff --git a/setup.py b/setup.py
index 7d39665..c09ae1a 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,4 @@
-import setuptools
-from distutils.core import setup
+from setuptools import setup
 
 
 with open("README.md", "r") as fh:
@@ -7,8 +6,13 @@ with open("README.md", "r") as fh:
 
 setup(
     name="pylnk3",
-    version="0.2.1",
-    py_modules=["pylnk"],
+    version="0.4.2",
+    py_modules=["pylnk3"],
+    entry_points={
+        'console_scripts': [
+            'pylnk3 = pylnk3:cli',
+        ],
+    },
     description="Windows LNK File Parser and Creator",
     author="strayge",
     author_email="strayge@gmail.com",
@@ -16,13 +20,16 @@ setup(
     keywords=["lnk", "shortcut", "windows"],
     license="GNU Library or Lesser General Public License (LGPL)",
     classifiers=[
-        "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.6",
+        "Programming Language :: Python :: 3.7",
+        "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
         "Intended Audience :: Developers",
         "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
         "Operating System :: OS Independent",
         "Topic :: Software Development :: Libraries :: Python Modules",
     ],
-    python_requires='>=3',
+    python_requires='>=3.6',
     long_description=long_description,
     long_description_content_type="text/markdown",
 )