Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

powershell help

Posted on 2016-07-28
6
Medium Priority
?
84 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
Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

 
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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

610 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