![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | run different scripts how do I run different script at the same tiime example from cmd line I what type in test.cmd and it will run test1.ps1, test2,ps1, and test3.ps1 |
My System Specs![]() |
| | #2 (permalink) |
| | Re: run different scripts You will need to path your scripts. PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} -- Brandon Shell --------------- Stop by my blog some time ![]() Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject -------------------------------------- "frank" <frank@discussions.microsoft.com> wrote in message news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... > how do I run different script at the same tiime > > example from cmd line I what type in test.cmd > and it will run > > test1.ps1, test2,ps1, and test3.ps1 |
My System Specs![]() |
| | #3 (permalink) |
| | Re: run different scripts Thanks Bradon but I want run from cmd propt I iusualy need user running these script and i do not want to go into powershell so , if can let me know how to do that I will greatful Frank "Brandon Shell" wrote: > You will need to path your scripts. > PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} > -- > Brandon Shell > --------------- > Stop by my blog some time ![]() > Blog: http://www.bsonposh.com/ > PSH Scripts Project: www.codeplex.com/psobject > -------------------------------------- > > "frank" <frank@discussions.microsoft.com> wrote in message > news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... > > how do I run different script at the same tiime > > > > example from cmd line I what type in test.cmd > > and it will run > > > > test1.ps1, test2,ps1, and test3.ps1 > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: run different scripts Thats a little more complicated do to the way command prompt processes the command. Why do you not want them to run powershell? It would seem they are comfortable with Command Shell. Just curious to the logic. -- Brandon Shell --------------- Stop by my blog some time ![]() Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject -------------------------------------- "frank" <frank@discussions.microsoft.com> wrote in message news:383898BA-E563-4F24-AA8C-44806BA0BF87@microsoft.com... > Thanks Bradon but I want run from cmd propt I iusualy need user running > these > script and i do not want to go into powershell > > > so , if can let me know how to do that I will greatful > > Frank > > > > "Brandon Shell" wrote: > >> You will need to path your scripts. >> PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} >> -- >> Brandon Shell >> --------------- >> Stop by my blog some time ![]() >> Blog: http://www.bsonposh.com/ >> PSH Scripts Project: www.codeplex.com/psobject >> -------------------------------------- >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... >> > how do I run different script at the same tiime >> > >> > example from cmd line I what type in test.cmd >> > and it will run >> > >> > test1.ps1, test2,ps1, and test3.ps1 >> >> |
My System Specs![]() |
| | #5 (permalink) |
| | Re: run different scripts this a users they want as simple as possible they just run a batch file and it will be done they do not what to launch powershell, then type in a long command line "Brandon Shell" wrote: > Thats a little more complicated do to the way command prompt processes the > command. > > Why do you not want them to run powershell? It would seem they are > comfortable with Command Shell. Just curious to the logic. > -- > Brandon Shell > --------------- > Stop by my blog some time ![]() > Blog: http://www.bsonposh.com/ > PSH Scripts Project: www.codeplex.com/psobject > -------------------------------------- > > "frank" <frank@discussions.microsoft.com> wrote in message > news:383898BA-E563-4F24-AA8C-44806BA0BF87@microsoft.com... > > Thanks Bradon but I want run from cmd propt I iusualy need user running > > these > > script and i do not want to go into powershell > > > > > > so , if can let me know how to do that I will greatful > > > > Frank > > > > > > > > "Brandon Shell" wrote: > > > >> You will need to path your scripts. > >> PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} > >> -- > >> Brandon Shell > >> --------------- > >> Stop by my blog some time ![]() > >> Blog: http://www.bsonposh.com/ > >> PSH Scripts Project: www.codeplex.com/psobject > >> -------------------------------------- > >> > >> "frank" <frank@discussions.microsoft.com> wrote in message > >> news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... > >> > how do I run different script at the same tiime > >> > > >> > example from cmd line I what type in test.cmd > >> > and it will run > >> > > >> > test1.ps1, test2,ps1, and test3.ps1 > >> > >> > > |
My System Specs![]() |
| | #6 (permalink) |
| | Re: run different scripts are they set scripts? meaning does the user specify which ones to run or do you just hard code it? -- Brandon Shell --------------- Stop by my blog some time ![]() Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject -------------------------------------- "frank" <frank@discussions.microsoft.com> wrote in message news 067AEA3-CF84-4274-A35A-86D9D37A48D8@microsoft.com...> this a users they want as simple as possible they just run a batch file > and > it will be done > > they do not what to launch powershell, then type in a long command line > > > > "Brandon Shell" wrote: > >> Thats a little more complicated do to the way command prompt processes >> the >> command. >> >> Why do you not want them to run powershell? It would seem they are >> comfortable with Command Shell. Just curious to the logic. >> -- >> Brandon Shell >> --------------- >> Stop by my blog some time ![]() >> Blog: http://www.bsonposh.com/ >> PSH Scripts Project: www.codeplex.com/psobject >> -------------------------------------- >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> news:383898BA-E563-4F24-AA8C-44806BA0BF87@microsoft.com... >> > Thanks Bradon but I want run from cmd propt I iusualy need user running >> > these >> > script and i do not want to go into powershell >> > >> > >> > so , if can let me know how to do that I will greatful >> > >> > Frank >> > >> > >> > >> > "Brandon Shell" wrote: >> > >> >> You will need to path your scripts. >> >> PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} >> >> -- >> >> Brandon Shell >> >> --------------- >> >> Stop by my blog some time ![]() >> >> Blog: http://www.bsonposh.com/ >> >> PSH Scripts Project: www.codeplex.com/psobject >> >> -------------------------------------- >> >> >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> >> news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... >> >> > how do I run different script at the same tiime >> >> > >> >> > example from cmd line I what type in test.cmd >> >> > and it will run >> >> > >> >> > test1.ps1, test2,ps1, and test3.ps1 >> >> >> >> >> >> |
My System Specs![]() |
| | #7 (permalink) |
| | Re: run different scripts well this goes back to my local user question I want the user to type in newuser.cmd username password this will call .$pwd/user.ps1 then it will run adduser.ps1 user name and password specified above then it run addtogroup.ps1 which add the user specified above to a hard coded group finnaly it runs folder.ps1 which creates a sub folder under d:\ftp the folder will be the same name as username so it will get that information from above thanks Frank "Brandon Shell" wrote: > are they set scripts? meaning does the user specify which ones to run or do > you just hard code it? > > -- > Brandon Shell > --------------- > Stop by my blog some time ![]() > Blog: http://www.bsonposh.com/ > PSH Scripts Project: www.codeplex.com/psobject > -------------------------------------- > > "frank" <frank@discussions.microsoft.com> wrote in message > news 067AEA3-CF84-4274-A35A-86D9D37A48D8@microsoft.com...> > this a users they want as simple as possible they just run a batch file > > and > > it will be done > > > > they do not what to launch powershell, then type in a long command line > > > > > > > > "Brandon Shell" wrote: > > > >> Thats a little more complicated do to the way command prompt processes > >> the > >> command. > >> > >> Why do you not want them to run powershell? It would seem they are > >> comfortable with Command Shell. Just curious to the logic. > >> -- > >> Brandon Shell > >> --------------- > >> Stop by my blog some time ![]() > >> Blog: http://www.bsonposh.com/ > >> PSH Scripts Project: www.codeplex.com/psobject > >> -------------------------------------- > >> > >> "frank" <frank@discussions.microsoft.com> wrote in message > >> news:383898BA-E563-4F24-AA8C-44806BA0BF87@microsoft.com... > >> > Thanks Bradon but I want run from cmd propt I iusualy need user running > >> > these > >> > script and i do not want to go into powershell > >> > > >> > > >> > so , if can let me know how to do that I will greatful > >> > > >> > Frank > >> > > >> > > >> > > >> > "Brandon Shell" wrote: > >> > > >> >> You will need to path your scripts. > >> >> PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& $_"} > >> >> -- > >> >> Brandon Shell > >> >> --------------- > >> >> Stop by my blog some time ![]() > >> >> Blog: http://www.bsonposh.com/ > >> >> PSH Scripts Project: www.codeplex.com/psobject > >> >> -------------------------------------- > >> >> > >> >> "frank" <frank@discussions.microsoft.com> wrote in message > >> >> news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... > >> >> > how do I run different script at the same tiime > >> >> > > >> >> > example from cmd line I what type in test.cmd > >> >> > and it will run > >> >> > > >> >> > test1.ps1, test2,ps1, and test3.ps1 > >> >> > >> >> > >> > >> > > |
My System Specs![]() |
| | #8 (permalink) |
| | Re: run different scripts Create a master script and cut/paste this. 1) Remember to add your folder code. 2) Remember to Insert the group name in the script Then Change your Batch file from powershell -noprofile pathtoscript\add-user.ps1 -user %1 -password %2 to powershell -noprofile pathtoscript\master.ps1 -user %1 -password %2 --------------------------- param([string]$user,[string]$password) If(!($server)){$server = get-content env:COMPUTERNAME} $srv = [ADSI]("WinNT://$server,computer") $newuser = $srv.psbase.children.add("$user","user") $newuser.psbase.invoke("SetPassword",$password) $newuser.psbase.CommitChanges() # $group = "<INSERT GROUP NAME HERE AND REMOVE #>" Write-Host "" Write-Host "Adding User [$user] to group [$group]" Write-Host $ary = @() $u = [ADSI]("WinNT://$server/$User,User") $ary += $u.psbase.path # Getting Group and Adding User $g = [ADSI]("WinNT://$server/$group,group") $g.psbase.invoke("add",$ary) Write-Host "If no Exception... User Added" -ForegroundColor Green ### ADD FOLDER CODE HERE ### -- Brandon Shell --------------- Stop by my blog some time ![]() Blog: http://www.bsonposh.com/ PSH Scripts Project: www.codeplex.com/psobject -------------------------------------- "frank" <frank@discussions.microsoft.com> wrote in message news 1EC680B-92BB-4BEA-8CD2-219C71FEF2BA@microsoft.com...> well this goes back to my local user question I want the user to type in > > newuser.cmd username password > > this will call .$pwd/user.ps1 > then it will run adduser.ps1 user name and password specified above > then it run addtogroup.ps1 which add the user specified above to a hard > coded group > finnaly it runs folder.ps1 which creates a sub folder under d:\ftp the > folder will be the same name as username so it will get that information > from > above > > > thanks > > > Frank > > "Brandon Shell" wrote: > >> are they set scripts? meaning does the user specify which ones to run or >> do >> you just hard code it? >> >> -- >> Brandon Shell >> --------------- >> Stop by my blog some time ![]() >> Blog: http://www.bsonposh.com/ >> PSH Scripts Project: www.codeplex.com/psobject >> -------------------------------------- >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> news 067AEA3-CF84-4274-A35A-86D9D37A48D8@microsoft.com...>> > this a users they want as simple as possible they just run a batch file >> > and >> > it will be done >> > >> > they do not what to launch powershell, then type in a long command line >> > >> > >> > >> > "Brandon Shell" wrote: >> > >> >> Thats a little more complicated do to the way command prompt processes >> >> the >> >> command. >> >> >> >> Why do you not want them to run powershell? It would seem they are >> >> comfortable with Command Shell. Just curious to the logic. >> >> -- >> >> Brandon Shell >> >> --------------- >> >> Stop by my blog some time ![]() >> >> Blog: http://www.bsonposh.com/ >> >> PSH Scripts Project: www.codeplex.com/psobject >> >> -------------------------------------- >> >> >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> >> news:383898BA-E563-4F24-AA8C-44806BA0BF87@microsoft.com... >> >> > Thanks Bradon but I want run from cmd propt I iusualy need user >> >> > running >> >> > these >> >> > script and i do not want to go into powershell >> >> > >> >> > >> >> > so , if can let me know how to do that I will greatful >> >> > >> >> > Frank >> >> > >> >> > >> >> > >> >> > "Brandon Shell" wrote: >> >> > >> >> >> You will need to path your scripts. >> >> >> PS> "test1.ps1","test2.ps1","test3.ps1" | %{invoke-expression "& >> >> >> $_"} >> >> >> -- >> >> >> Brandon Shell >> >> >> --------------- >> >> >> Stop by my blog some time ![]() >> >> >> Blog: http://www.bsonposh.com/ >> >> >> PSH Scripts Project: www.codeplex.com/psobject >> >> >> -------------------------------------- >> >> >> >> >> >> "frank" <frank@discussions.microsoft.com> wrote in message >> >> >> news:67D8EFCE-93CE-4B17-916D-90A8EF243BD0@microsoft.com... >> >> >> > how do I run different script at the same tiime >> >> >> > >> >> >> > example from cmd line I what type in test.cmd >> >> >> > and it will run >> >> >> > >> >> >> > test1.ps1, test2,ps1, and test3.ps1 >> >> >> >> >> >> >> >> >> >> >> >> |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| run .cmd scripts on remote machine (automating the MOSS install via scripts) | PowerShell | |||
| Sql scripts | PowerShell | |||
| Scripts | Vista mail | |||
| PS scripts -> VBS | PowerShell | |||
| UAC and scripts (.wsf) | Vista security | |||