Solved

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

Posted on 2011-02-21
6
580 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
  • 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 500 total points
ID: 35003531
What is happening when the scheduled task runs? Is anything happening?
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Suggested Solutions

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…

730 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