Share |

Marcus' Macro Blog

Mostly tips, tutorials, articles and news about Macro Scheduler & Windows Automation

Archive for the ‘Vista’ Category



Vista RC1 Annoyances

Thursday, September 7th, 2006

Well, after painstakingly working with the Vista UAC team at Microsoft to ensure Macro Scheduler would be Vista compatible, and lots of testing with the Vista betas I was happy to report a while back that Macro Scheduler ran well under Vista beta 2. Recently Vista RC1 was made available under our MSDN subscription so we installed it. Guess what? Well, unfortunately it seems things have changed again and there are now a few things that fail to work under the default restricted user account. I’m pretty sure we just need to make a few tweaks and everything will be hunky dory again in due course. But I’m somewhat annoyed that after our efforts to ensure the software worked with beta 2 it seems lots has changed in RC1.

I’m resisting the urge to turn UAC off. I’m only leaving the default settings intact so that I can be sure Macro Scheduler will install and run under the default configuration. But oh how annoying it is! Try just copying and overwriting a file in the program folder – something power users will do all the time. What a nightmare. Honestly – how many dialogs are really needed for a simple file copy!?

Sometimes I feel like Microsoft’s security philosophy with Vista is analogous to building a house with no doors and windows. Utterly secure and impenetrable but also completely unusable! OK, that’s a bit unfair, it’s more like a door with 15 locks. Very secure, and just about usable … but frustratingly unfriendly!

Update: Ok, I may have ranted too soon. Turns out the problem with Macro Scheduler under Vista RC1 was due to a change we’d inadvertently made, rather than a change in Vista. Looks like we have it sorted!

Do or Die for Windows Vista

Friday, September 1st, 2006

According to Sven Hallauer, Director of Windows Release Management, in a podcast interview yesterday, Microsoft has only a couple of weeks to ensure all critical bugs are fixed and in place to meet the Vista deadline. Any delay and the bugs either won’t get fixed, or the release date will slip.

Certainly Vista Release Candidate 1 is much more polished than Beta 2 and it does seem like Microsoft has stepped up a gear to try to meet their target release date.

Listen to the interview with Sven Hallaur in which he explains the build process behind Windows Vista.

Vista Delayed Again?

Tuesday, August 1st, 2006

Lots of people are saying Vista won’t make it for the current launch Schedule. Robert McLaws at Longhorn Blogs says Vista Needs More Time. Scoble agrees. I say get the product right, even if it means a delay and a short term hit on stock price. This is a major new operating system after all.

Don’t Disable Vista Security Features

Wednesday, June 28th, 2006

Great post by Jesper Johansson, Senior Security Strategist at Microsoft, on Vista security and why beta testers should not disable User Account Control just yet: http://tinyurl.com/j5z7x. Worth a read.

Vista too Chatty?

Friday, June 9th, 2006

If you’ve been playing with the Vista betas recently you’ll have noticed how often it asks for your permission to perform admin level functions. By default Vista runs all users as ordinary level users (even if you’re logged in as an Admin) and asks for permission via “Elevation Prompts” every time an admin function is required. All fine and dandy – and much more secure – in theory, but many people have commented on how “chatty” this makes Vista. Early betas were worse and just copying a file can be really quite annoying.

Well, Steve Hiskey of the Windows Security Core Group over at Microsoft has written about how they intend to reduce elevation prompts and how they are working hard, both internally and with external ISVs, to make Vista a little less “noisy”. Well worth a read if you’re concerned about all those pesky elevation prompts, or if you’re writing applications for Vista and want to help improve things.

The UAC team have quite a challenging role – to make using Vista more secure without making it more cumbersome and more difficult to use than XP. They still have a few challenges ahead of them, but I can vouch for their commitment and support for independent software vendors as Steve and his team were extremely supportive in helping us ensure Macro Scheduler could record properly in Vista. So if you’re beta testing Windows Vista be sure to help them out via their blog.

Reducing Elevation Prompts in RC1

Vista Beta 2 Launched to the Public

Thursday, June 8th, 2006

The Windows Vista Customer Preview Program was launched yesterday evening making Vista beta 2 available to everyone. Until now it has been confined to members of the Technical Beta Program and MSDN subscribers. Now anyone can download it or order a copy on DVD. So if you are wanting to try Vista out now is your chance.

http://www.microsoft.com/windowsvista/getready/preview.mspx

Vista Beta 2 Released

Thursday, May 25th, 2006

So Vista Beta 2 was made available to MSDN subscribers this week. We installed a copy yesterday and my first impressions are good. It installed quickly with the minimum of fuss and the performance is good – it seems pretty quick. Beta 1 was agonisingly slow so it’s good to note that beta 2 is faster. No doubt beta 1 had lots of debug/diagnostic code in it which was slowing things up, and they’ve probably worked on improving performance generally since beta 1. Macro Scheduler 8.0.3 runs nicely in beta 2, as I expected :-)

Now that beta 2 is here things should start to settle down, documentation will hopefully improve, and more developers will start working on Vista-izing their software. So things should become clearer and we can hopefully get a better idea on what it will take to create a Vista version of AutoLogon. Watch this space.

Vista Application Compatibility

Thursday, May 11th, 2006

As you know we have been working hard on ensuring Macro Scheduler is compatible with Vista and our latest 8.0.2 maintenance release is built with support for Vista. But what about other applications?

Well, Microsoft’s “Application Experience Team” have started their own blog to provide resources for testing application compatibility and “To help make the Application Compatibility process manageable and successful for you, and help us learn about your experiences”. Their first post links to Microsoft Connect where you can sign up for the Application Compatibility Toolkit V5.0 Beta program to receive tools to test your existing applications for Vista compatibility.

Check out All Things AppCompat.

Vista Delayed

Wednesday, March 22nd, 2006

Microsoft have just announced that Vista will be delayed and won’t be generally available until the beginning of 2007. Read the official announcement.

This doesn’t really surprise me. Since November 2005 we have been working with the Vista beta releases to ensure Macro Scheduler will be Vista ready. Finding the information we needed to achieve this has been difficult and it is clear that much of the SDK and documentation is still not complete. In the end I had to get in touch directly with the Vista UAC team at Microsoft in order to make any real progress. It is clear that there is still a lot of work to be done and I just couldn’t see Vista being ready by the end of the year. Vista makes a complete paradigm shift in security by restricting default user accounts to standard level privileges. The discussion in the developer newsgroups makes it painfully clear that this will have huge implications on many existing applications and the way Windows software has been written in the past.

Delaying the general availability of Vista until 2007 has got to be a good thing. It is better that Microsoft concentrate on quality and get things working properly than rush the release out. Developers also need time to assess the implications and work on compatibility changes and for many this delayed release will cause a sigh of relief.

Running UI macros when logged out with Remote Desktop

Monday, March 20th, 2006

Scheduling User Interface (UI) automation macros to occur when Windows is logged off or locked is problematic. A full user session needs to be active for a UI macro to work. Why is this? Windows consists of “Window Stations” and “Desktops”. A window station is a secure object that contains a clipboard, a set of global atoms and a group of Desktops. The interactive window station assigned to the logon session of the interactive user also contains the keyboard, mouse, and display device. The interactive window station is visible to, and can receive input from, the user. All other window stations are non-interactive, which means that they cannot be made visible to the user, and cannot receive input. So only one Window Station, and one Desktop at a time can receive keyboard and mouse input, while all others are invisible. While logged out the only thing you can do is log in. Services can run while Windows is logged out but they run in their own session and there is no desktop to interact with. So any macros scheduled from a service will run invisibly and cannot mimic user input.

Usually, if you have a UI macro which must run regularly, the simplest and most reliable approach is to schedule it on a machine which is left logged in and never logged out. Many of our clients even dedicate an old machine to Macro Scheduler. Where security is an issue they leave it locked in an office or secure computer room. This is fine where you have control of the machine, but what if you need to schedule a UI automation routine on a client’s computer and they, understandably, insist that this machine should not be left logged in?

Well, with Macro Scheduler version 8.0 we introduced the Scheduler Service and AutoLogon which allows macros to be scheduled when Macro Scheduler is not running and to automate a Windows Logon so that the full session is available. However, there are still some problems with this approach. One is that interactive services are being phased out with Vista and even in XP sometimes have problems – the concept of interactive services has always been a bit of a workaround and Microsoft are finally removing them altogether to guard against OS shatter attacks and other issues that allowing interactive services can cause. Another problem is that AutoLogon cannot work with fast user switching. Of course, the other obvious issue with AutoLogon is that although the machine doesn’t have to be left logged in, AutoLogon does mean that for the duration of the macro Windows is unlocked. For some, even this temporary log in might be unacceptable – and what if the macro fails half way through, leaving the session open?

With Vista dropping interactive services and changing the entire logon mechanism we are currently investigating whether or not there is any way we can implement an alternative AutoLogon solution. Vista is still in beta and with the Vista SDK and documentation being incomplete and sketchy it’s still too early to tell whether or not we can implement a Vista compatible version of AutoLogon. But there is already an approach, using existing Windows functionality, which works well with XP and Vista.

This approach involves two PCs and Remote Desktop Connection. The machine on which the routine must run needs to allow Remote Desktop Connections. A good guide on enabling Remote Desktop Connections can be found here. Macro Scheduler and the UI macro must be installed on this machine.

On the other machine create a Remote Desktop Profile (RDP) file. To do this click Start/Run and type mstsc.exe. On the Remote Desktop Connection dialog that appears click “Options”. You’ll get this screen:

rdp1.JPG

Select the name of the computer you will connect to and enter the username and password. Check “Save my password”.

Click the “Programs” tab. Here you tell Remote Desktop Connection to run the Macro Scheduler macro:

rdp2.JPG

Enter the path to Macro Scheduler’s executable followed by the macro name:

“c:\program files\mjt net ltd\macro scheduler\msched.exe” myMacro

Under “Display” you can set whether the desktop session should run full screen, or whatever resolution you like. It doesn’t really matter.

Back under the “General” tab hit “Save As” and save the rdp file.

Now, when you want to run the routine you just issue:

mstsc.exe rdpfile.rdp

E.g. if you saved the file to c:\my documents\serverauto.rdp you would run:

mstsc.exe “c:\my documents\serverauto.rdp”

When this runs, a desktop session is created and the UI macro is executed – it works because the only interactive Window Station is the one created by Remote Desktop Connection. When the macro finishes, the session is logged out again. The desktop session appears on your screen. Nothing appears on the remote machine – it remains logged out. But Remote Desktop Session creates a window session and the Macro Scheduler UI routine runs within it. You can now schedule this command to run at the required time, either in Macro Scheduler or in Windows Task Scheduler.

The beauty of this approach is that it works even when both machines are locked or logged out. The only time it won’t work is if you minimize the Remote Desktop Connection. When you do that the session stops responding to keystrokes and mouse events. So if you are logged in, leave it open.

This method is ideal for scheduling processes to run on remote machines or on customer machines, where you can control the schedule from your end. But it is equally useful for scheduling processes internally where you don’t want the machine physically logged in. Until we find a replacement for AutoLogon in Vista, it is also a nice workaround if you need to schedule macros in Vista and do not want to leave the server unlocked.

Instead of setting the macro to run in the Remote Desktop Connection dialog, you could set the macro to run on startup and have the script check to see whether the current user is logged in via the console or via RDP (to avoid it running when a regular log in takes place). An example of how to determine whether the user is logged in locally or via Remote Desktop can be found here.

With Macro Scheduler scheduling the script on the client, other ways to start the script once the desktop connection is open could include assigning the remote script to a hotkey and having the client script send the key sequence; installing msNet on the server and issuing a HTTPRequest to run the script once the desktop connection is up; or if the two computers clocks are well synchronised just schedule the script on the server to happen shortly after the desktop connection is scheduled, allowing enough time for the log in to take place. Instead of installing Macro Scheduler on the remote machine you could also compile the macro to an executable and install just the executable macro on the server, and set it to run when Remote Desktop connects.