?
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
?
582 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

Does Your Cloud Backup Use Blockchain Technology?

Blockchain technology has already revolutionized finance thanks to Bitcoin. Now it's disrupting other areas, including the realm of data protection. Learn how blockchain is now being used to authenticate backup files and keep them safe from hackers.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

777 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