Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 33255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:53:32+00:00 2026-05-10T13:53:32+00:00

Wrote the following in PowersHell as a quick iTunes demonstration: $iTunes = New-Object -ComObject

  • 0

Wrote the following in PowersHell as a quick iTunes demonstration:

$iTunes = New-Object -ComObject iTunes.Application $LibrarySource = $iTunes.LibrarySource foreach ($PList in $LibrarySource.Playlists) {   write-host $PList.name } 

This works well and pulls back a list of playlist names. However on trying to close iTunes a warning appears

One or more applications are using the iTunes scripting interface. Are you sure you want to quit?

Obviously I can just ignore the message and press [Quit] or just wait the 20 seconds or so, but is there a clean way to tell iTunes that I’ve finished working with it?

Itunes 7.7.1, Windows XP 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T13:53:32+00:00Added an answer on May 10, 2026 at 1:53 pm

    Here is one thing that I did on my a Powershell script that adds podcasts to iTunes. I use Juice on a server to download all the podcasts that I listen to. The script uses .Net methods to release the COM objects. When I wrote my iTunes script I had read a couple of articles that stated you should release your COM objects using .NET.

         [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$LibrarySource)     [void][System.Runtime.InteropServices.Marshal]::ReleaseComObject([System.__ComObject]$iTunes) 

    I also run my scripts the majority of time from a shortcut, not from the powershell prompt.

    Based on your comments, I did some testing and I determined that I would get the message when running against iTunes, if I ran my script in a way that leaves powershell running. iTunes seems to keep track of that. Running the script in a manner that exits it’s process after running, eliminated the message.

    One method of running your script from powershell, is to prefix your script with powershell.

    powershell .\scriptname.ps1

    The above command will launch your script and then exit the process that was used to run it, but still leaving you at the powershell prompt.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following PowerShell script: function Alpha { # write-output 'Uncomment this line and
I'm trying to write a PowerShell script that will do the following: Executes a
I am using the IIS Powershell snapin to configure a new web application from
Following encryption and decryption algorithms are called via powershell and in a sharepoint application
If I want to create a .NET object in the powershell I write something
I have the following powershell script: $BizTalkHosts = BTSSvc* Foreach($svc in Invoke-Command -Computer d-vasbiz01
If I do the following in a PowerShell script: $range = 1..100 ForEach ($_
I have a PowerShell script with the following excerpt: foreach ($pc in $ComputerName) {
I define a custom PowerShell type with New-Object. I would like a parameter to
I have the following code: $project.PropertyGroup | Foreach-Object { if($_.GetAttribute('Condition').Trim() -eq $propertyGroupConditionName.Trim()) { $a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.