2.79b to run script using command line in windows, preferably with a desktop shortcut or exe Here's the code i have written so far, it's working inside blender text editor.
I however like to run this script without opening blender, with command-line, better yet to create a shortcut icon on a PC to run it, hoping to make this friendly and available for people who do not know blender well.

import bpy
import os

# get the current path and make a new folder for the exported meshes
path = bpy.path.abspath('//stl/')

if not os.path.exists(path):
    os.makedirs(path)



# deselect all meshes
bpy.ops.object.select_all(action='DESELECT')

# select the object
#object.select = True
object = bpy.data.objects['pboard']
object.hide_select = False
object.select = True
bpy.context.scene.objects.active = object

# export object with its name as file name
fPath = str((path + object.name + '.stl'))

#bpy.context.active_object = object
bpy.ops.export_mesh.stl(filepath=fPath, use_selection=True)


object.hide_select = True
Find the blender.exe and Right Click and select Create Shortcut



Due to permissions I cannot create a shortcut in the Blender folder so it offers to create it on the Desktop.

Find the shortcut and Right Click and select Properties



In the Target box append 

 -b c:\tmp\target.blend --python c:\tmp\exportscript.py


to the fully quoted blender.exe 
e.g.

"C:\Program Files\Blender Foundation\Blender\blender.exe" -b c:\tmp\target.blend --python c:\tmp\exportscript.py


Where target.blend is the blender file with the "pboard" object to export and exportscript.py is the original posters code with the "path" value set to match your environment.

I created a c:\tmp folder that has full permissions for the blender user and set the path

path = "C:\\tmp\\stl\\"


Now when I double click the shortcut, a command window flashes open briefly before closing. The file C:\tmp\stl\pboard.stl" is then available.