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 - Schedule PowerShell script with Windows Server 2003

Reply
 
Old 09-16-2009   #1 (permalink)
GreGSeeN


 
 

Schedule PowerShell script with Windows Server 2003

Hallo,

I don't geht to schedule a powershell scribt. Could someone help???

That is what I've done:

Scriptfile:
EventCreate.ps1 (This file contain the code)

Bat-File:
EventCreate_run.bat

Content of this Bat-File:
"PowerShell.exe .\EventCreate.ps1"

If I schedule the the Bat-File, following error-message occur:
"PowerShell.exe -file .\EventCreate.ps1 'PowerShell.exe' is not recognized
as an internal or external command, operable program or batch file."

But I am wondering why the script run, if I start the Bat-File manuell by
doppleclick!!

I hope someone could help me with this!!

Greez

My System SpecsSystem Spec
Old 09-16-2009   #2 (permalink)
Vadims Podans [MVP]


 
 

Re: Schedule PowerShell script with Windows Server 2003

Perhaps PowerShell.exe path doesn't exist in %path% variable. You have 2
choises:
1) add path C:\Windows\System32\WindowsPowerShell\v1.0 to %path% variable
2) type full path to PowerShell.exe:
%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe
--
WBR, Vadims Podans
MVP: PowerShell
PowerShell blog - www.sysadmins.lv

"GreGSeeN" <GreGSeeN@newsgroup> rakstīja ziņojumā
"newsBE09D97-3F83-43ED-A3FD-63CE3A0C66B7@newsgroup"...
Quote:

> Hallo,
>
> I don't geht to schedule a powershell scribt. Could someone help???
>
> That is what I've done:
>
> Scriptfile:
> EventCreate.ps1 (This file contain the code)
>
> Bat-File:
> EventCreate_run.bat
>
> Content of this Bat-File:
> "PowerShell.exe .\EventCreate.ps1"
>
> If I schedule the the Bat-File, following error-message occur:
> "PowerShell.exe -file .\EventCreate.ps1 'PowerShell.exe' is not recognized
> as an internal or external command, operable program or batch file."
>
> But I am wondering why the script run, if I start the Bat-File manuell by
> doppleclick!!
>
> I hope someone could help me with this!!
>
> Greez
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Exchange 2003 Powershell Script PowerShell
Powershell script needed for Exchange 2003 PowerShell
Re: How to schedule a vbscript as a Scheduled Task in Server 2003 VB Script
PowerShell installation on Windows Server 2003 SP2 PowerShell
How to schedule a Powershell script?? 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