?
Solved

powershell help

Posted on 2016-07-28
6
Medium Priority
?
76 Views
1 Endorsement
Last Modified: 2016-07-29
Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe " "http://www.google.com" -Credential (Get-Credential)

getting the following error

Start-Process : This command cannot be run due to the error: The directory name is invalid.
At line:1 char:1
+ Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe " "http ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Start-Process], InvalidOperationException
    + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
1
Comment
Question by:Jorge Ocampo
[X]
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
6 Comments
 
LVL 5

Expert Comment

by:Eric C
ID: 41733866
On that computer, press Windows-R to bring up the 'Run' dialog box.

Copy and paste in this command:
   C:\Program Files\Internet Explorer\iexplore.exe
Press Enter

Does Internet Explorer launch?
If not, then that's the problem.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 41733869
yea it does run, it even runs with the following

Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe " "http://www.google.com"

only problem is the credentials part
0
 
LVL 20

Expert Comment

by:Peter Hutchison
ID: 41733877
Try changing the Execution Policy from the default to Remote Signed:
Set-ExecutionPolicy RemoteSigned

Also try changing your command to use single quotes for the url
Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe " 'http://www.google.com'
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
LVL 5

Expert Comment

by:Eric C
ID: 41733900
what happens if you remove the quotes from around "http://www.google.com" altogether ?
0
 
LVL 13

Accepted Solution

by:
Dustin Saunders earned 2000 total points
ID: 41733905
You have to include the working directory if impersonating a user in c#/Powershell.  Try:

Start-Process -FilePath "C:\Program Files\Internet Explorer\iexplore.exe" "www.google.com" -Credential (Get-Credential) -WorkingDirectory "C:\Program Files\Internet Explorer\"

Open in new window


*edit - I had taken out the www.google.com, put it back in.
1
 
LVL 2

Author Closing Comment

by:Jorge Ocampo
ID: 41734641
Thank you it worked
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

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.
Previously, on our Nano Server Deployment series, we've created a new nano server image and deployed it on a physical server in part 2. Now we will go through configuration.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses

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