title: Getting : Microsoft VBScript compilation error: Expected ')'
body: <p>I am new to vb script and want to create a shortcut for my .exe application which will open in an invisible window. Here is the code which I have written</p>
  
  <pre><code>Option Explicit
  
  Private Sub Command1_Click()
  'This will Create a ShortCut of test_application in our desktop, its name is "My-Test",    invisible windows when run, use the 2nd icon as the Shortcut icon.'
  
  Create_ShortCut "C:\MyApp\bin\test_application.exe", "Desktop", "My-Test", , 0, 1
  End Sub
  
  Sub Create_ShortCut(ByVal TargetPath As String, ByVal ShortCutPath As String, ByVal    ShortCutname As String, Optional ByVal WorkPath As String, Optional ByVal Window_Style As Integer, Optional ByVal IconNum As Integer)
  
  Dim VbsObj As Object
  Set VbsObj = CreateObject("WScript.Shell")
  
  Dim MyShortcut As Object
  ShortCutPath = VbsObj.SpecialFolders(ShortCutPath)
  Set MyShortcut = VbsObj.CreateShortcut(ShortCutPath &amp; "\" &amp; ShortCutname &amp; ".lnk")
  MyShortcut.TargetPath = TargetPath
  MyShortcut.WorkingDirectory = WorkPath
  MyShortcut.WindowStyle = Window_Style
  MyShortcut.IconLocation = TargetPath &amp; "," &amp; IconNum
  MyShortcut.Save
  
  End Sub
  </code></pre>
  
  <p>I am stored the script as test.vbs and executed it in the following way</p>
  
  <pre><code>C:\Users\me\Desktop&gt;cscript test.vbs
  </code></pre>
  
  <p>and it gave me the following error</p>
  
  <pre><code>Microsoft (R) Windows Script Host Version 5.8
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  C:\Users\me\Desktop\test.vbs(9, 38) Microsoft VBScript compilation error: Expected ')'
  </code></pre>
  
  <p>Is this a good way to create a shortcut or is there any better and more verbose way to do it ?</p>