Missing expression after ','

Posted on 2012-04-02
Medium Priority
Last Modified: 2012-04-02

When I execute :
      [string]$A = "",
      [string]$I = "",
      [string]$S = "",
        [string]$g = "",
        [string]$T = "",
        [string]$f = "",
        [string]$u = "",
        [string]$up = "",
        [string]$c = "",
        [string]$cp = "",
        [string]$v = "",
        [string]$ip = "",
        [string]$r = "",
      [switch]$Help ,

$net = new-object -ComObject WScript.Network
$net.MapNetworkDrive("z:", "\\server", $false,`"$u`", `"$up`")

The following error is returned :
Missing expression after ','.
At C:\install_bin_1-0.ps1:45 char:75
+ $net.MapNetworkDrive("z:", "\\server", $false, <<<< `"$u`", `"$up`")
    + CategoryInfo          : ParserError: (,:String) [], ParseException
    + FullyQualifiedErrorId : MissingExpressionAfterToken


Question by:bibi92
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

Xizz earned 2000 total points
ID: 37795427
You are doing strange things for me here:

$net.MapNetworkDrive("z:", "\\server", $false,`"$u`", `"$up`")

I think it must be something like:

$net.MapNetworkDrive("z:", "\\server", $false,"$u", "$up")

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question