Jump to content

Recommended Posts

Posted (edited)

Hi :)

 

I "made" this smale batch to make edge start up with this tabs everytime the computer reboots.

I put it in the Startup folder and it seems works ok.

The problem is that it has to run on User lever, and in user level the CMD is disabled, but they can run Powershell.

So how do make the batch run in Powershell instead?

 

%1 @echo off

# setup MS edge with tabs

cls

start /MIN /B microsoft-edge:"http://www.cnn.com/

start /MIN /B microsoft-edge:"https://www.google.com/

start /MIN /B microsoft-edge:"https://www.cia.gov/

start /MIN /B microsoft-edge:"http://travel.state.gov/

Exit

 

 

 

If anybody has a better way to make edge start up with favorite Tab, i'm all ears. :)

 

It as work from within SCCM.

Edited by denmyos
Posted

I can't use GPO cause the computers are not in a Domain

I tried Local gpo put that did not do the trick.

 

I agree with you on the powershell,, dont know why its not disable.

Posted (edited)
So how do make the batch run in Powershell instead?

Here's a PowerShell version of your batch file.

 

Start-Process -FilePath "microsoft-edge:https://www.google.co.uk" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.bing.co.uk" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://start.duckduckgo.com" -WindowStyle Maximized

 

Edit. With your URLs...

 

Start-Process -FilePath "microsoft-edge:https://www.cnn.com" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.google.com" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.cia.gov" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://travel.state.gov" -WindowStyle Maximized

Edited by Arthur
Posted

It seems to work but only half.

 

When i put the script on the desktop and double click it, it works.

But when i put in "c:\users\Bruger\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

I get a error ...."is not recognized as the name of a cmdlet function script file or operable program"

 

 

​Any idears?

Posted

That's odd... it should be a command taken from the standard PowerShell modules... what happens when you add the following line to the start?

 

Import-Module Microsoft.PowerShell.Management[/Code]

Posted
Here's a PowerShell version of your batch file.

 

Start-Process -FilePath "microsoft-edge:https://www.google.co.uk" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.bing.co.uk" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://start.duckduckgo.com" -WindowStyle Maximized

 

 

 

Edit. With your URLs...

 

Start-Process -FilePath "microsoft-edge:https://www.cnn.com" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.google.com" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://www.cia.gov" -WindowStyle Minimized
Start-Process -FilePath "microsoft-edge:https://travel.state.gov" -WindowStyle Maximized

 

Just to clarify, the "-filePath" do you want the path to MS edge... or do i just leave it blank.?

Posted
Just to clarify, the "-filePath" do you want the path to MS edge... or do I just leave it blank?

You could try adding the full path to Edge, but you shouldn't need it.

 

Does your PowerShell ISE have a different execution policy than PowerShell? Could that be why it isn't running?

Posted
You could try adding the full path to Edge, but you shouldn't need it.

 

Does your PowerShell ISE have a different execution policy than PowerShell? Could that be why it isn't running?

Im new at this so i don't really know what you mean, sorry.

 

But i did some fooling around, and put the script in the "Documents" folder.. And they open with no errors.!

So it must be a restictions in the "startup" folder

 

They both have "Read-Only"

So i don't know what other restrictions the "startup" folder is having.

Posted

I read something about this line

powershell.exe -Sta -File script.ps1

That the powershell should start up in -STA!??

 

Put dont know where to put that line in my script?

Posted

This

Start-Process "%windir%\explorer.exe shell:appsfolder\Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge" "Microsoft-edge:https://www.cnn.com"

 

Gives me this error in Powershell ISE

 

PS C:\WINDOWS\system32> C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\edge01.ps1Start-Process : This command cannot be run due to the error: The system cannot find the file specified.At C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\edge01.ps1:1 char:1+ Start-Process -Filepath "%windir%\explorer.exe shell:appsfolder\Micro ...+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Posted (edited)
I'm new at this so i don't really know what you mean, sorry.

What do you get if you run the following command in both PowerShell and the PowerShell ISE? Are they both set to "RemoteSigned" or something else?

 

Get-ExecutionPolicy

 

So it must be a restrictions in the "startup" folder

It could be a restriction since the Startup folder is one of the locations frequently used by malware.

 

Perhaps it might be worth trying a scheduled task that runs the PowerShell script on login?

 

https://blogs.technet.microsoft.com/askpfeplat/2015/04/26/the-startup-script-is-dead

Edited by Arthur
Posted

gpedit.PNG

 

No cigar either.

But i don't really know what script parametre to put in,, (if any)

 

I don't understand why its so difficult to have windows 10 start up MS Edge up with tabs.!!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...