Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - how to start a written script

Reply
 
Old 08-13-2007   #1 (permalink)
Jens Diekers


 
 

how to start a written script

Hello again,

i hope i don't have a stupid question. Look, when i will start a written
..ps1 script from the commandline (in this context: powershell.exe -noexit
&"c:\tmp\script.ps1"), the powershell starts, but the script won't execute. i
have also set the executionpolicy to unrestricted. Where is the trick?

Thanks for your support...

My System SpecsSystem Spec
Old 08-13-2007   #2 (permalink)
Shay Levi


 
 

Re: how to start a written script

What's in the script? Make the script emit something, can you see the output?

Shay
http://scriptolog.blogspot.com



> Hello again,
>
> i hope i don't have a stupid question. Look, when i will start a
> written .ps1 script from the commandline (in this context:
> powershell.exe -noexit &"c:\tmp\script.ps1"), the powershell starts,
> but the script won't execute. i have also set the executionpolicy to
> unrestricted. Where is the trick?
>
> Thanks for your support...
>



My System SpecsSystem Spec
Old 08-13-2007   #3 (permalink)
Jon


 
 

Re: how to start a written script


"Jens Diekers" <JensDiekers@discussions.microsoft.com> wrote in message
news:6951874B-719C-4BB0-9D23-185FDB53245D@microsoft.com...
> Hello again,
>
> i hope i don't have a stupid question. Look, when i will start a written
> .ps1 script from the commandline (in this context: powershell.exe -noexit
> &"c:\tmp\script.ps1"), the powershell starts, but the script won't
> execute. i
> have also set the executionpolicy to unrestricted. Where is the trick?
>
> Thanks for your support...



The '&' should be inside the double quotes eg

powershell.exe -noexit "& 'c:\tmp\script.ps1'"

--
Jon


My System SpecsSystem Spec
Old 08-13-2007   #4 (permalink)
Jens Diekers


 
 

Re: how to start a written script

Hi Jon, and Shay,

i have already solved the problem. I have had a bad syntax in my dsadd
command.
THX for your fast support.

Have a nice day
My System SpecsSystem Spec
Old 08-13-2007   #5 (permalink)
Brandon Shell


 
 

Re: how to start a written script

Why use dsadd? I would recommend getting familiar with .NET
DirectoryEntry/DirectorySearcher classes... They should be fairly easy to
pickup.

"Jens Diekers" <JensDiekers@discussions.microsoft.com> wrote in message
news:590D3B33-B3C1-4482-A031-B868B68B0F72@microsoft.com...
> Hi Jon, and Shay,
>
> i have already solved the problem. I have had a bad syntax in my dsadd
> command.
> THX for your fast support.
>
> Have a nice day


My System SpecsSystem Spec
Old 08-13-2007   #6 (permalink)
Hal Rottenberg


 
 

Re: how to start a written script

On Aug 13, 8:14 am, "Brandon Shell" <tshell.m...@mk.gmail.com> wrote:
> Why use dsadd? I would recommend getting familiar with .NET
> DirectoryEntry/DirectorySearcher classes... They should be fairly easy to
> pickup.


Got any nice examples laying around anyone?

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
powershell script so double click to start another app PowerShell
start word, excel from script VB Script
Re: Failed to start a program by script VB Script
Pin to start menu via script General Discussion
Start-Demo - a script to help you run demos PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46