![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Trouble executing a command Hello all This is my DOS command: "C:\Program Files\7-Zip\7z" a -tzip \\server\dats\dailyDats.zip db_20080522.dat ....which works fine. In Powershell I've coded this: $a="C:\Program Files\7-Zip\7z.exe" invoke-expression $a "a -tzip \\server\dats\dailyDats.zip db_20080522.dat" I've tried it with the parameter string in single quotes, double quotes and no quotes, and I've tried loading the whole expression into $a but I always get Invoke-Expression : A parameter cannot be found that matches parameter name 'a'. At line:1 char:18 + invoke-expression <<<< $a a -tzip \\server\dats\dailyDats.zip db_20080522.dat Can somebody tell me what I'm doing wrong? Thanks in advance Jacques |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||||||||||||||
| Guest | Re: Trouble executing a command I'd tried that - it was the first thing I did - but I must have screwed up the syntax because I tried again at your suggestion and this time it worked! How annoying! After that I tried 4872 different permutations (perhaps I exaggerate slightly), none of which worked. Possibly it's just that you have a magic touch. Many thanks again Shay. Jacques "Shay Levi" <no@xxxxxx> wrote in message news:95d808932cea88ca8bcca32a65b0@xxxxxx
| ||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||
| | #3 (permalink) | ||||||||||||
| Guest | Re: Trouble executing a command Try with the call operator (&) & $a a -tzip \\server\dats\dailyDats.zip db_20080522.dat --- Shay Levi $cript Fanatic http://scriptolog.blogspot.com
| ||||||||||||
My System Specs![]() | |||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Invoke-Expression executing a command with spaces | Ashish | PowerShell | 4 | 12-06-2007 02:03 PM |
| Executing CMD.EXE from PowerShell | Stephen Wood | PowerShell | 2 | 11-01-2007 12:54 PM |
| executing another app | Cory Nelson | PowerShell | 1 | 03-04-2007 11:55 PM |
| Executing from \\127.0.0.1\C$ doesn't work | Keith Hill [MVP] | PowerShell | 7 | 01-25-2007 08:38 AM |
| Executing a command like run [command] | Singee | PowerShell | 5 | 06-05-2006 02:17 PM |