![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | newb - replacing an old "sweep" program, exec an external program I am just getting started with PowerShell, again. I am building a replacement for an old utility that would start at the current directory and iterate down through the folders and simply execute the command given on the command line. Sweep.exe CMDTORUN PARMSFORCMDTORUN This doesn't work because it seems like it wants to know where the program is. And if it is an internal cmd.exe command I'd have to know that. I'd like to just dump what ever the $cmd onto the prompt and let it go. Just like perl backticks. I know the attrib could be readily done in the script, but this isn't for me to use. So how do I go about executing an external program without knowing its location or whether or not it is an internal cmd.exe command? Thanks, jeff $cmd = "attrib -a" $dirList = Get-ChildItem -path $baseDir -recurse | Where {$_.psIsContainer -eq $true} foreach ($dir in $dirlist) { &$cmd $dir.fullName } |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Help Me Topic]Unexisting program still inside "Uninstall or change a Program" | Arakai | General Discussion | 2 | 02-08-2008 12:59 PM |
| Can't get rid of "Info Icon" pop-up "This program cannot display.. | MEL652 | Vista General | 0 | 02-05-2008 09:02 AM |
| Can't exec a program from another | STAN1ZX | Vista security | 0 | 11-01-2007 11:43 AM |
| Microsoft exec: Future versions of Windows to be "fundamentally redesigned" | Tiberius | Vista General | 3 | 05-30-2007 06:23 PM |
| "Recently Opened Programs" list and "Search for program" fail | Jelle Kooi | Vista installation & setup | 0 | 02-13-2007 06:10 AM |