[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using Task Scheduler to Open a VB Scrpit that opens a progam, and does a couple commands

Posted on 2011-02-21
6
Medium Priority
?
583 Views
Last Modified: 2012-08-13
Hello, I need help. I can run my VB Script while on the server and it performs. Just when i am trying to do it as a scheduled task it does not work. I have tried to create a batch file to put in Task Scheduler to run the script and no luck. Below is my vb script.

Set WSHshell=CreateObject("WScript.Shell")
'open docstar client
WSHShell.Run "C:\docstar\dsclient.exe"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
'This enters the username to login
WSHShell.sendkeys "username"
WSHShell.sendkeys "{enter}"
'This enters the Pasword to login
WSHShell.sendkeys "password"
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
'The rest below selects docs to file and auto files them
WSHShell.sendkeys "^f"
wscript.sleep (5000)
WSHShell.sendkeys "^a"
wscript.sleep (5000)
WSHShell.sendkeys "%f"
WSHShell.sendkeys "a"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
wscript.sleep (5000)
WSHShell.sendkeys "{enter}"
0
Comment
Question by:ccrockett1027
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 14

Expert Comment

by:Psy053
ID: 34947557
If the Task was scheduled to occur during an Interactive Logon, it should work fine.

However, if the Task is scheduled to occur when there is no Interactive Logon,  it will fail, due to the use of the SendKeys method.

0
 

Author Comment

by:ccrockett1027
ID: 34951785
I tried that and it did not work. I would run the task while being logged into the account that it is authenticating with. The only way the script would run is if i manually invoke (click) the script. Does anyone have a way that may be different than what i have done to get the same result?
0
 
LVL 14

Accepted Solution

by:
Psy053 earned 2000 total points
ID: 35003531
What is happening when the scheduled task runs? Is anything happening?
0
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

Assisted Solution

by:ccrockett1027
ccrockett1027 earned 0 total points
ID: 35007709
Nothing happens if i am lgged in or not.

Thanks for the help Psy053.

I after contacting or software vendor we found a way for the program to do what i wanted to script.

Thans Agian
0
 

Author Comment

by:ccrockett1027
ID: 35007752
1
0
 

Author Closing Comment

by:ccrockett1027
ID: 35045469
Had to contact our software vendor. they helped us thru the process in there programming to do what i wanted with the script
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Resolving an irritating Remote Desktop connection that stops your saved credentials from being used.
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
Progress

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question