Friday, January 09, 2009
Deployment Forum HomeDeployment Forum ArticlesDeployment Forum Download LibraryDeployment Forum Member BlogsDeployment Forum Community Forums
Member Login
StandardLiveID


Register
Forgot Password ?



Guests can view and read messages in the community forums, but you must register and log in to Deployment Forum before you can post messages. Click Register at the top of this page. Before posting messages, please read the forum guidelines at the bottom of this page.

Subject: VBscript Sendkeys
Prev Next
You are not authorized to post a reply.

AuthorMessages
mla1User is Offline

Posts:50

Send Message
09/04/2008 4:21 AM  

Hello, I am using a vbscript which uses the sendkeys function to set some setting in the OS.   When I run the script manually the send keys works.  when I run the commmand as part of a task sequence the script does not work because microsoft deployment is disrupting the flow of the send keys commands. 

How would I instruct deployment to stop what it is doing until the process has finished.

THanks

FarmerPeteUser is Offline

Posts:168

Send Message
09/04/2008 10:46 AM  
I've never had an issue with the timing aspect, but I have had issues with MDT taking the focus away from the current app that I wanted to work with. I've found AutoHotKey or AutoIT work much better than sendkeys. If that isn't the problem and the problem really is the task sequence isn't waiting for the vbscript to complete, the simplest thing would be to make a bat file that calls the vbscript and then waits for x seconds to give it time to complete. Other options that "may" work would be to call your command like this, "cmd /c start /wait wscript.exe vbscript.vbs"

On a side note, what command are you using to call the script currently?

DietmarUser is Offline

Posts:70

Send Message
09/05/2008 2:49 AM  
We create in this case AutoIt-Scripts. This works fine and has a lot of script functionality like Sleep() for example. Look at this: it´s free and really easy to learn! http://www.autoitscript.com/autoit3/
FarmerPeteUser is Offline

Posts:168

Send Message
09/08/2008 7:54 AM  
The differences between AutoIT and AutoHotKey are very minimal. AHK is a little easier to learn, but it is a tad less powerful. The syntax is very similar between the two, and either one will do macoing for you. AHK's main advantage is the use of hotkeys to initiate macros.

http://cedeq.com/blog/automation/autohotkey-vs-autoit/
mla1User is Offline

Posts:50

Send Message
09/09/2008 3:58 AM  

In answer to your question I placing the sendkeys.vbs in the scripts folder inserting a "run command line" task sequence

Name =                      Sendkeys

Command Line =        wscript.exe sendkeys.vbs

Start in =                    %SCRIPTROOT%

 

I will try your command line 1st then look at autoIT.

 

thanks for all your feedback.

mla1

FarmerPeteUser is Offline

Posts:168

Send Message
09/09/2008 8:02 AM  
The command I use for vbscripts are similar to below. I don't use a working directory.

cscript.exe "%SCRIPTROOT%\Custom Scripts\CreateUser.vbs"
DavidUser is Offline

Posts:50

Send Message
09/12/2008 4:35 PM  
I would look into alternatives to sendKeys method.. maybe one already mentioned above or, depending on what you are trying to configure: 1) check out WMI classes, you can do tons of configuration with these, or 2) if its a shell/console program that does the configuring you can use wscript's wscript.Shell object to execute and interact with it via stdIn, stdOut, and stdErr.  
You are not authorized to post a reply.
Forums > Deployment Solutions > MDT 2008 > VBscript Sendkeys



ActiveForums 3.7
Forum Policies
Minimize

These forums are a user-supported community for IT professionals to exchange deployment tips, solutions, and techniques. For the benefit of all Deployment Forum members, please observe the following guidelines when posting to these forums:

  • We reserve the right to remove any message. Our moderators will remove all messages that are not respectful or productive. Profanity, racism, prejudice, and flaming are not tolerated.
  • Do not advertise products or services. Our moderators will remove all advertisements or service announcements. Product and service recommendations from active Deployment Forum members are encouraged, however.
  • Make sure your question isn't already answered. Before posting questions, search the forums. After ensuring that your questions are unique, post them to the most appropriate forum. This will help reduce noise in the forums.
  • Help make the most of each thread. Do not post unrelated messages to a thread. Also, if you've resolved a question outside of these forums, please share the solution with other members by posting it back to the thread.
  • Do not share confidential information. Confidential information includes product keys and addresses. Our moderators will edit any message containing confidential information, so double-check messages and their attachments before posting them.
  • Post messages using only the English language. For the benefit of all Deployment Forum members, please post your messages using the English language.

We hope that you enjoy using this community. Please submit your comments and feedback on the Comments and Feedback page or post them to the Comments, Feedback forum.



Privacy Statement  |  Terms Of Use
© 2007 Jerry Honeycutt