Script using Windows PowerShell ISE to move mouse and control keyboard

Hello,
I am new to PowerShell scripting, and fairly new to scripting in general.
I would like to create a script that would move the mouse to a certain location, double click, enter a number, click tab 3 three times, click spacebar, close window.
I started with: [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(230,175);
But I couldn't find how to double click.
I would appreciate your help very much.

##In order to move the mouse position you could use something like this:
[system.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | out-null
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point(500,500)
##In order to simulate a mouse click you could use something like this:
function Click-MouseButton
param(
[string]$Button, 
[switch]$help)
$HelpInfo = @'
Function : Click-MouseButton
Purpose  : Clicks the Specified Mouse Button
Usage    : Click-MouseButton [-Help][-Button x]
           where      
                  -Help         displays this help
                  -Button       specify the Button You Wish to Click {left, middle, right}
if ($help -or (!$Button))
    write-host $HelpInfo
    return
else
    $signature=@' 
      [DllImport("user32.dll",CharSet=CharSet.Auto, CallingConvention=CallingConvention.StdCall)]
      public static extern void mouse_event(long dwFlags, long dx, long dy, long cButtons, long dwExtraInfo);
    $SendMouseClick = Add-Type -memberDefinition $signature -name "Win32MouseEventNew" -namespace Win32Functions -passThru 
    if($Button -eq "left")
        $SendMouseClick::mouse_event(0x00000002, 0, 0, 0, 0);
        $SendMouseClick::mouse_event(0x00000004, 0, 0, 0, 0);
    if($Button -eq "right")
        $SendMouseClick::mouse_event(0x00000008, 0, 0, 0, 0);
        $SendMouseClick::mouse_event(0x00000010, 0, 0, 0, 0);
    if($Button -eq "middle")
        $SendMouseClick::mouse_event(0x00000020, 0, 0, 0, 0);
        $SendMouseClick::mouse_event(0x00000040, 0, 0, 0, 0);
##To use this function in your script, implement a command like: Click-MouseButton -Button left
##Or you could just use WASP..

Similar Messages

  • How to execute SQL Script using windows powershell(using invoke-sqlcmd or any if)

    OS : Windows server 2008
    SQL Server : SQL Server 2012
    Script: Test.sql (T-SQL)  example : "select name from sys.databases"
    Batch script: windows  MyBatchscript.bat ( here connects to sql server using sqlcmd  and output c:\Testput.txt) 
     (sqlcmd.exe -S DBserverName -U username -P p@ssword -i C:\test.sql -o "c:\Testoutput.txt)  ---it working without any issues.....
    This can execute if i double click MyBatchscript.bat file and can see the output in c:\testput.txt.
    Powershell: Similarly, How can i do in powershell 2.0 or higher versions?  can any one give full details with each step?
    I found some of them online, but nowhere seen clear details or examples and it not executing through cmd line (or batch script).
    example: invoke-sqlcmd -Servernameinstance Servername -inputfile "c:\test.sql" | out-File -filepath "c:\psOutput.txt"  --(call this file name MyTest.ps1)
    (The above script working if i run manually. I want to run automatic like double click (or schedule with 3rd party tool/scheduler ) in Batch file and see the output in C drive(c:\psOutput.txt))
    Can anyone Powershell experts give/suggest full details/steps for this. How to proceed? Is there any configurations required to run automatic?
    Thanks in advance.

    Testeted the following code and it's working.....thanks all.
    Execute sql script using invoke-sqlcmd with batch script and without batch script.
    Option1: using Import sqlps
    1.Save sql script as "C:\scripts\Test.sql"  script in side Test.sql: select name from sys.databases
    2.Save Batch script as "C:\scripts\MyTest.bat" Script inside Batch script:
    powershell.exe C:\scripts\mypowershell.ps1
    3.Save powershell script as "C:\scripts\mypowershell.ps1"
    import-module "sqlps" -DisableNameChecking
    invoke-sqlcmd -Servername ServerName -inputFile "C:\scripts\Test.sql" | out-File -filepath "C:\scripts\TestOutput.txt"
    4.Run the Batch script commandline or double click then can able to see the output "C:\scripts\TestOutput.txt" file.
    5.Connect to current scripts location  cd C:\scripts (enter)
    C:\scripts\dir (enter )
    C:\scripts\MyTest.bat (enter)
    Note: can able to see the output in "C:\scripts" location as file name "TestOutput.txt".
    Option2: Otherway, import sqlps and execution
    1.Save sql script as "C:\scripts\Test.sql"  script in side Test.sql: select name from sys.databases
    2.Save powershell script as "C:\scripts\mypowershell.ps1"
    # import-module "sqlps" -DisableNameChecking #...Here it not required.
    invoke-sqlcmd -Servername ServerName -inputFile "C:\scripts\Test.sql" | out-File -filepath "C:\scripts\TestOutput.txt"
    3.Connect to current scripts location
    cd C:\scripts (enter)
    C:\scripts\dir (enter )
    C:\scripts\powershell.exe sqlps C:\scripts\mypowershell.ps1 (enter)
    Note: can able to see the output in "C:\scripts" location as file name "TestOutput.txt".

  • [Forum FAQ] How to find and replace text strings in the shapes in Excel using Windows PowerShell

    Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
    shapes in Excel Object.
    Since the Excel.Application
    is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
    interact with Excel document.
    The figure below is an excel file:
    Figure 1.
    You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
    $text = “text1”,”text2”,”text3”,”text3”
    $Excel 
    = New-Object -ComObject Excel.Application
    $Excel.visible = $true
    $Workbook 
    = $Excel.workbooks.open("d:\shape.xlsx")      
    #Open the excel file
    $Worksheet 
    = $Workbook.Worksheets.Item("shapes")       
    #Open the worksheet named "shapes"
    $shape = $Worksheet.Shapes      
    # Get all the shapes
    $i=0      
    # This number is used to replace the text in sequence as the variable “$text”
    Foreach ($sh in $shape){
    $sh.TextFrame.Characters().text  
    # Get the textbox in the shape
    $sh.TextFrame.Characters().text = 
    $text[$i++]       
    #Change the value of the textbox in the shape one by one
    $WorkBook.Save()              
    #Save workbook in excel
    $WorkBook.Close()             
    #Close workbook in excel
    [void]$excel.quit()           
    #Quit Excel
    Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
    Besides, we can also find the documents about these methods and properties in MSDN:
    Workbook.Worksheets Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
    Worksheet.Shapes Property:
    http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
    Shape.TextFrame Property:
    http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
    TextFrame.Characters Method (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
    Characters.Text Property (Excel):
    http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
    After running the script above, we can see the changes in the figure below:
    Figure 2.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Thank you for the information, but does this thread really need to be stuck to the top of the forum?
    If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
    EDIT: I see this is no longer stuck to the top of the forum, thank you.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Use Windows PowerShell to count and list total number of items in Folders E-Mail in Office Outlook?

    I have the need to generate a list of all outlook folders and the total number of items listed beside each folder name. I thought I could simply modify the script from " http://blogs.technet.com/b/heyscriptingguy/archive/2009/01/26/how-do-i-use-windows-powershell-to-work-with-junk-e-mail-in-office-outlook.aspx
    " regarding the total number of items in the junk folder but no luck.
    I thought I could just simply duplicate line 6 of the aforementioned script
    "$folder = $namespace.getDefaultFolder($olFolders::olFolderJunk) " and change the folder name but getting the "Method invocation failed because [Microsoft.Office.Interop.Outlook.OlDefaultFolders] does not contain a method
    named 'olFolder'.
    At line:7 char:1
    + $folder = $namespace.getCurrentFolder($olFolders::olFolder("Design Engineering S ...
    I've found a way to export a list of all these folders using exportoutlookfolders.vbs to a txt file but doesn't include total number of items.
    Looking for any pointers on how to make this work. Don't expect anyone to write it for me but I am still learning PS. Would be great to find a way to import all of these folder and subfolder names into the script. Will be appreciative of any advice though.
    There's an enormous amount of Outlook folders.
    Outlook 2013
    Windows 8
    Thanks,
    Barry

    Since I am not and administrator, but an end user, I do not have access to the Get-Mailxxxx commandlets to make this really easy and had to do this long hand.
      The following will pull folder.name, folder.items.count, and sum the total size of each folder's items for all folders and their subs. 
    Just one warning, the summation can take some time with a large PST file since it needs to read every email in the PST. 
    There is also some minor formatting added to make the results a little more readable.
    $o
    = new-object
    -comobject outlook.application 
    $n
    = $o.GetNamespace("MAPI") 
    $f
    = $n.GetDefaultFolder(6).Parent 
    $i
    = 0
    $folder
    = $f
    # Create a function that can be used and then re used to find your folders
    Function
    Get-Folders()
    {Param($folder)
     foreach($folder
    in $folder.Folders)   
    {$Size =
    0
    $Itemcount
    = 0
    $foldername
    = $folder.name
    #Pull the number of items in the folder
    $folderItemCount
    = $folder.items.count
    #Sum the item (email) sizes up to give the total size of the folder
    foreach ($item
    in $folder.Items)
    {$Itemcount
    = $Itemcount
    + 1
    $Size =
    $Size +
    $item.size
    Write-Progress -Activity ("Toting size of "
    + $foldername
    + " folder.")
    -Status ("Totaling size of "
    + $Itemcount
    + " of "
    + $folderItemCount
    + " emails.")
    -PercentComplete ($itemcount/$folderItemCount*100)
    # just a little formating of the folder name for ease of display
    While($foldername.length
    -le 19){$foldername
    = $foldername
    + " "}
    #Write the results to the window
    Write-Host ("-folder "
    + $foldername
    + "  
    -itemcount " +
    "{0,7:N0}" -f
    $folderItemCount +
    "   -size " +
    "{0,8:N0}" -f ($size/1024)
    + " KB")
    #If the folder has a sub folder then loop threw the Get-Folders function.
    #This two lines of code is what allows you to find all sub folders, and
    #sub sub folders, and sub sub sub for as many times as is needed.
    If($folder.folders.count
    -gt 0)
    {Get-Folders($folder)}
    get-folders($folder)

  • [Forum FAQ] "Unable to connect to the server by using Windows PowerShell Remoting" error while installing RDS roles on Server 2012 R2

    When you try to install RDS role on server 2012 R2 using standard deployment, this issue may occur (Figure 1).
    “Unable to connect to the server by using Windows PowerShell remoting”.
    Figure 1: Unable to connect to the server by using Windows PowerShell remoting
    First of all, we need to verify the configurations as it suggested:
    1. The server must be available by using Windows PowerShell remotely.
    2. The server must be joined to a domain.
    3. The server must be running at least Windows Server 2012 R2.
    4. The currently logged on user must be a member of the local Administrators group on the server.
    5. Remote Desktop Services connections must be enabled by using Group Policy.
    In addition, we need to check if the “Windows Remote Management “service is running and related firewall exceptions have been created for WinRM listener.
    To enabling PowerShell remoting, we can run this PowerShell command as administrator (Figure 2).
    Enable-PSRemoting -Force
    Figure 2: Enable PowerShell Remoting
    However, if issue persists, we need to check whether it has enough memory to work.
    By default, remote shell allots only 150 MB of memory. If we have IIS or SharePoint App pool, 150 MB of memory is not sufficient to perform the remoting task. Therefore, we need to increase
    the memory via the PowerShell command below:
    Set-Item WSMan:\localhost\Shell\MaxMemoryPerShellMB 1000
    Then, you need to restart the server and the issue should be resolved.
    You can get more information regarding Remote Troubleshooting by below link:
    about_Remote_Troubleshooting
    If you need further assistance, welcome to post your questions in the
    RDS forum.
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    i found another possible reason, this solution worked for me:
    http://oyvindnilsen.com/solution-for-powershell-remoting-error-it-cannot-determine-the-content-type-of-the-http-response-from-the-destination-computer/
    I tried to set up powershell remoting on a server and kept getting this error:
    Enter-PSSession : Connecting to remote server failed with the following error message : The WinRM client cann
    ot process the request. It cannot determine the content type of the HTTP response from the destination comput
    er. The content type is absent or invalid. For more information, see the about_Remote_Troubleshooting Help to
    pic.
    After a bit of troubleshooting I discovered that the problem was that the authentication packets was to big (over 16k), this will cause WinRM to reject the request. The reason for authentication packets getting too big can be because the user is member of very
    many security groups or in my case because of the SidHistory attribute.
    The solution was to increase the MaxFieldLength and MaxRequestBytes keys in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\HTTP\Parameters
    If the keys does not exists you can create them, be sure to use the DWORD type.
    I sat MaxFieldLength to DEC value 40000 and MaxRequestBytes to DEC value 32768 and rebooted the server. Problem solved.

  • Just FYI, new blog post "Deploy BranchCache Content and Hosted Cache Servers Using Windows PowerShell"

    Just FYI, new blog post "Deploy BranchCache Content and Hosted Cache Servers Using Windows PowerShell" at
    http://aka.ms/le85n3
    Thanks -
    James McIllece

    Great to see new BranchCache content out there!
    We created a BranchCache info page to try to get all of the relevant info into one place for V1 and 2
    http://2pintsoftware.com/microsoftbranchcache
    thanks
    Phil
    Phil Wilcock http://2pintsoftware.com @2pintsoftware

  • I would like to AirPlay mirror my iMac and be able to use both my magic mouse and wireless keyboard, but the bluetooth range won't let me. Is there a way to extended its range?

    I am buying an iMac to AirPlay mirror on my big screen TV with AppleTV (2nd generation). But my TV is located far away from my iMac and I won't be able to use my magic mouse or wireless keyboard via bluetooth connection. I know I can use an app to simulate both mouse and keyboard, but I really need to use the actual devices.  
    I wish there was a way to pair them to my iPad or iPhone, via bluetooth, and control my iMac via network. It is a cheap solution, as I wouldn't need to buy any other device. I believe all these devices, without modifications, have enough technology to be able to work as I've imagined. The only need was to adapt the software.
    Is there a solution simple as this one, or do I have to buy a Bluetooth extender in order to use my magic mouse and wireless keyboard? If so, which BT extender do you suggest and what is its range?
    Thank you!

    If you are still under warranty, contact Apple to get it serviced. You can also visit an Apple Store or Authorized Apple Service Provider to get it looked at.
    iPhone - Contact Support - Apple Support

  • Hi, I'm using windows 8 on my new PC and would like to sync my iPhone calendar with it.  Is it possible?  How do I do it?  Thanks iPhone 4,

    Hi, I'm using windows 8 on my new PC and would like to sync my iPhone calendar with it.
    Is it possible?
    How do I do it?
    Thanks
    iPhone 4,

    Easiets thing to do is use iCloud. Download & install the Windows Control Panel:
    http://support.apple.com/kb/dl1455

  • Now I am using Windows Xp Labview program now i want control the Sun Solaris OS Board.Is it Possible in Windows XP Labview?

    Now I am using Windows Xp Labview program now i want control the Sun Solaris OS Board.Is it Possible in Windows XP Labview?

    You better should post your question in the LabVIEW forum - this one here is dedicated to LabWindows/CVI...

  • Will magic mouse and wireless keyboard work with my G4?

    hello, i have a 1.25 Ghz ppc g4 imac and have leopard installed. i was wondering if i get a bluetooth dongle and a magic mouse and wireless keyboard would it work? would i also need a special kind of bluetooth adapter? i already have airport extreme, im going for the modern mac one wire (power cord) look. thank you.

    According to this on the Apple Store:
    http://store.apple.com/us/product/MB829LL/A?fnode=MTY1NDA1Mg
    the Magic Mouse requires at least OS 10.5.8 whcih you don't have.
    The current wireless keyboard requires 10.6 which cannot run on a G4 iMac.
    I would look to third-party solutions. I like Logitech input devices:
    http://www.logitech.com/en-us/home
    However, even the Logitech devicez may require a higher version of the Mac OS than you have. Be certain to check system requirements very closely before buying something.

  • Mighty Mouse and Wireless Keyboard w/ Windows 7 in BC

    Cannot get these to work after Windows 7 install;  at all and I've googled solutions until my eyeballs are dry.  Tried to delete the devices then re-add.  This managed to get the mouse working temporarily.  Keyboard would not connect at all.  The device manager sees the devices but cannot connect.  Restarted under windows once the mouse was working and on the start it lost the connection.  Now it cannot connect to either device.  Restarted under OSX and both devices run fine.  Hate to go have to buy a wired board and mouse just for this crappy OS (along with the Windows 7 cost and office cost this is RIDICULOUSLY expensive all because of software developers won't write for what will be the largest company on the stock exchange....insane....
    Anyone with a similar experience who could shed any light how to get this to work would be more than appreciated

    Can anyone help with the latest correct fix for the problem of wireless keyboard and mouse using windows 7 on boot camp pleeeeeeze?
    I bot a wired keyboard to finish the install on the boot camp partition and only have 2 weeks to return the keyboard so I am desperately trying to get the wireless periph's to work on the windows side.  aside from that the OS on the windows side does not recognize the numeric keypad part of the wired larger keyboard.
    help please......

  • Can javamail use windows default outgoing smtp mail server and port?

    how can i use windows default outgoing smtp service and port from javamail? is it possible to retrieve this info or just instruct javamail to use default?
    thanks

    Windows doesn't have a default SMTP server. However if you have something like Outlook or Outlook Express or Eudora or Netscape Mail or whatever set up on your Windows box, you will have already told it what SMTP server it should connect to.
    That information would be in the Windows registry, or in the config file of whatever e-mail client you already have set up. However it's probably easier to just have your application ask for the SMTP server's name again rather than trying to find where some other application stashed it.

  • How I got the Bluetooth Magic mouse and Aluminum keyboard to work in XP

    NOTE: The following steps fixed my issue. I thought I would share what worked for me but I really don't ever visit these discussion groups. I used a combination of Sysinternal tools to isolate what was causing my issue and rectified it.
    I couldn't for the life of me get the bluetooth magic mouse and keyboard working in a bootcamp'd windows xp. Here are the steps that I performed to finally get it to work. The assumptions are that you are running a clean XP build with SP3 and all windows updates installed.
    1. Using a USB mouse and keyboard. Insert the OS X install disc into the drive and run through the bootcamp drivers install. (These steps are outlined at Page 12 in the Apple Boot Camp Installation Guide: http://manuals.info.apple.com/en/bootcampinstall-setup.pdf). Let the installers run per apple instructions in the bootcamp installation guide. At the end it will want to reboot. Reboot the system.
    2. After the system reboots login and run the Apple Software Update utility to update from bootcamp 3.1 to 3.2. It will run through a bunch of installers and ask to reboot at the end. Reboot.
    3. After the system reboots login and go to start=>run and type "services.msc" to bring up the services control panel.
    4. Double-click the "Bluetooth Support Service" to open the properties.
    5. Go to the "log on" tab and look to see what is set. If it is set to "NT Authority\LocalService" then click above it to change to "Local System account." Then click "OK." It will tell you the changes won't take effect until the service is restarted. No worries.
    6. You will be back in the main services control panel. Make sure the "Bluetooth Support Service" is highlighted and look up to the left and select "restart the service."
    7. Close all the open windows and then go to start=>run and type "control panel" and hit enter.
    8. Double-click the "Bluetooth devices" control panel applet and follow the Apple instructions provided on Page 18 of the guide referred to earlier. Start with the mouse first. Stop when done with the mouse and don't continue on to the keyboard yet.
    9. At this point my mouse was "installed" but did not show "connected" in the bluetooth devices applet. I then highlighted the mouse and clicked the "properties" button down to the right.
    10. Once in the properties of the mouse I selected the "services" tab. My issue before making the switch to "Local System" account for the Bluetooth services was then when I tried to click the check box to enable "Drivers for keyboard, mice, etc (HID)" I would get an "access denied" error. Now that the switch has been made you should be able to click that check box without error. Click OK after enabling.
    11. You will suddenly see systray (lower right of the screen where the clock is) saying that new hardware has been detected and enabled. Once this is all done you will see "connected" below the device in the Bluetooth applet. Give your mouse a go. It should be working now. Sweet!
    12. Follow the steps in the Apple guide for your keyboard. This should work too now. Sweet!
    Best of luck.

    It depends on how far it is and how thick your walls are. If there plasterboard partitions and only 10 feet apart then probably.
    If you have a mobile phone with bluetooth, then try sending the computer a picture of file from similar distances to that you intend using the keyboard, if it works then a bluetooth keyboard and mouse should.

  • Use FMS & Actionscript to Stream Audio/Video and control (powerpoint) slides

    Hi there,
    My compnay provides webcasting services to numerous clients, and we currently use Windows Media Encoder as our base software for these projects.
    However, I'm interested in switching to Flash Media Server, but need to figure out one issue and how to implement it in such a way like how we are currently using Windows Media Encoder.
    We need a way to stream out a live audio/video feed AND have a way to control a presenter's POWERPOINT slides and have them advance by our command when streaming live.
    Basically, the way we do it is we will stream out audio/video from WME and also use the encoder's SCRIPTING functions to send out a "url"  from the encoder to the actual page in which the viewer is watching the live embedded stream.  On that page is an embeded/internal frame which we can specify (using the id/name) that the url gets loaded, and this actually advances the slides (or more so pulls up a pre-created html page of the next slide in the person's powerpoint, which is actually a screenshot or exported image of that slide and embedded within a specific HTML file and hosted on the same server as the embedded player/html file)
    Would there be a way to send out this same type of script using FMS?   I've been playing around with it and notice the interface itself does not have a built in scripting function like Windows Media Encoder does. However, I did read somewhere that it supports ActionScript... but I have no clue how to implement this feature.
    I am just curious how it might be able to go about doing this?  Is there a way to use an [action]script with FMS and have it send out a URL to a specific frameset embedded on the same page as the Flash Media Encoder Playback?
    Hopefully this make sense and that someone can point me in the right direction.  Switching to FMS over Windows Media Encoder is the way I would love to go, just need to figure out how this could be done.
    Would a better method be converting the powerpoint slides to a swf or flv file, embedding that file within the same page as the FMS playback, and somehow using a script to "advance" the frames/slides/scenes within that file?
    I also heard something about Flash "Shared Objects" and how this could be a way of controlling a swf file remotely.....
    Could anyone give me some advice and know a method that I could use to achieve this type of implementation?
    Any help is GREATLY appreciated!   Thanks!

    FMS (the interactive version, FMIS) has complete scripting support.
    What you want to do can be done with FMS, and there are a lot of ways you can approach it. Converting to .swf can be helpful, as it means you have a single resource to load rather than a bunch of individual slide images (the flashplayer can load .swf, jpg, gif, png). Rather than embedding, I'd opt to make it an external resource and load it at runtime... that would keep the player application reusable.
    To get an idea of how to use server side actionscript, see the getting started portion of the FMS 3.5 dev docs
    http://help.adobe.com/en_US/FlashMediaServer/3.5_Deving/
    Then, see the SSAS docs for the following classes in particular:
    The Client class for Client.call()
    The Stream class for Stream.send()
    The Shared object class
    The Application class for BroadcastMsg()
    The docs give some general overview for the usage of each. The best choice really depends on your deployment architecture and scalability requirements.

  • Magic Mouse and Wireless Keyboard: Should charge off iMac

    Apple, you've been shipping Bluetooth peripherals that require disposable batteries for years. It's time to design long-lasting rechargeable batteries into these devices.
    Years ago I open-lettered the idea of designing Apple's BT devices with built-in rechargeable batteries. The basic idea consists of a USB cable that is used periodically to connect to the CPU and to the devices. The devices would have a red and green light that become visible when depleted or charged respectively. When the devices require a charge, the USB cable is connected to the iMac and then to the device. The USB cable is put away once the green light indicates a full charge.
    No visual clutter, no batteries to dump into the landfill.
    While I'm not a rabid environmentalist, the fact that Apple is speaking openly about it's accomplishments in this area (http://www.apple.com/macbookpro/environment.html), while at the same time shipping a Mac that requires disposable batteries is a bit of a letdown to this longtime Mac buyer (since 1986).
    Throwaway batteries are unnecessary.
    The technology exists to include a long life built-in rechargeable battery. A USB charging cable, used as described above, would not clutter Apple's design intentions for the new iMacs. Instead, it would strengthen Apple's Green Design goals.
    Apple has had years to noodle out such a feature. In my opinion, there's no excuse for this oversight.

    Hi Chillspike. In response to your comment, +"Is one or two wires (keyboard & mouse) too much clutter for people?..."+
    Not all of us have a lot of computer space. My iMac is on a small table along with my TV, cable box, DVD player, etc. I have a rats nest of wires in the back, including my internet receiver, USBs for my iPod, wireless keyboard, and wireless trackball, a backup hard drive, and my printer (I have to switch something else out in order to plug it in). I might sit on the edge of my bed and put the keyboard in my lap, although I usually stretch out in bed a few feet away to work.
    I had a wired keyboard and trackball a while ago, and nearly pulled the computer off the table a couple of times as I was trying to get settled in! So going wireless is as much a matter of practicality for some of us, as your preference for hard wiring is for you. If you prefer being wired, I hope someone comes up with a product that meets your needs - and maybe by the time they do they will have the "bugs" worked out of this new one.

Maybe you are looking for