Solved

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

Posted on 2011-02-21
6
574 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
Comment Utility
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
Comment Utility
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
Comment Utility
What is happening when the scheduled task runs? Is anything happening?
0
Shouldn't all users have the same email signature?

You wouldn't let your users design their own business cards, would you? So, why do you let them design their own email signatures? Think of the damage they could be doing to your brand reputation! Choose the easy way to manage set up and add email signatures for all users.

 

Assisted Solution

by:ccrockett1027
ccrockett1027 earned 0 total points
Comment Utility
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
Comment Utility
1
0
 

Author Closing Comment

by:ccrockett1027
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now