Thanks for the cattleprod.  I needed it today.

 

 

From: Damien Solodow [mailto:[email protected]] 
Posted At: Wednesday, June 06, 2012 2:54 PM
Posted To: [email protected]
Conversation: Powershell and dos batch
Subject: RE: Powershell and dos batch

 

The error message you provided in your last message was from the
powershell script. So your batch is executing the script, but the script
is borked.

That's why my last post said to try changing your script. J

 

With something like this I find it best to break it down into steps:

First make sure your powershell script works.

Second, make sure your batch can execute a simple powershell script (a
one-liner with write-host is good)

Combine and serve.

 

DAMIEN SOLODOW

Systems Engineer

317.447.6033 (office)

317.447.6014 (fax)

HARRISON COLLEGE

 

From: [email protected] [mailto:[email protected]] 
Sent: Wednesday, June 06, 2012 2:15 PM
To: NT System Admin Issues
Subject: RE: Powershell and dos batch

 

Killing me man.  Killing me.

I open a dos window

I change directory to the powershell directory

I execute powershell -file "myfile.ps1"

I get nothing.

Top it off I am trying to execute some BackupExec powershell commands in
myfile.ps1 and I am not sure they want to play nice either.

Really just an example of a powershell being executed within DOS is all
I need to get this going.

 

 

From: Andrew S. Baker [mailto:[email protected]] 
Posted At: Wednesday, June 06, 2012 1:45 PM
Posted To: [email protected]
Conversation: Powershell and dos batch
Subject: Re: Powershell and dos batch

 

Who says it isn't simple?  (And why do you think it should be more
simple than it already is?)


ASB

http://XeeMe.com/AndrewBaker

Harnessing the Advantages of Technology for the SMB market...

 

On Wed, Jun 6, 2012 at 1:19 PM, [email protected] <[email protected]>
wrote:

Really struggling with this.  It should be so simple.

 

 

From: Joseph L. Casale [mailto:[email protected]] 
Posted At: Wednesday, June 06, 2012 12:49 PM
Posted To: [email protected]
Conversation: Powershell and dos batch
Subject: RE: Powershell and dos batch

 

>From a DOS shell, type `powershell.exe -?` and you'll see how to invoke
a session with a script and all the other options which may need to
apply. 

 

jlc

________________________________

From: [email protected] [[email protected]]
Sent: Wednesday, June 06, 2012 10:07 AM
To: NT System Admin Issues
Subject: Powershell and dos batch

I have need to running a powershell script for Backup Exec 2012 through
a DOS batch file.

Here is what I have so far:

 

::Batch File

::powershell

 

C:\windows\system32\WindowsPowerShell\v1.0\powershell.exe
"'e:\in01\oper\task\BackupJob.ps1'"

exit

_______________________

BackupJob.ps1

Import-Module BEMCLI | Get-BEJob -Name "BackupJob-Full" | Start-BEJob |
exit

 

 

Where the BackupJob is already set up in the GUI library on the server.

I get nothing.

The batch file just finishes.

I put a pause after it and I see no errors?

So what am I doing wrong and how do I make it work?

Thanks

 

 

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here:
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here:
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here:
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin


~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

---
To manage subscriptions click here: 
http://lyris.sunbelt-software.com/read/my_forums/
or send an email to [email protected]
with the body: unsubscribe ntsysadmin

Reply via email to