Showing posts with label vbs. Show all posts
Showing posts with label vbs. Show all posts

Wednesday, March 7, 2012

Schedule question

Hello all!

I have a small .vbs script that I would like to run as a step in the SQL scheduler. The script is "MsgBox("Database Transfer Succesfull!")"

The client wants to something to let the end user know it was succesful with a pop up message. But it doesn't work, and just hangs up my process. The other steps are SP's and a DTS run.

Any idea's?

TIA!!

Rudy

The SQL Agent is architectured to run on servers, even without any user being logged on when the scheduled task is executed. So it runs the program in separate session, and this message box is "displayed" on the invisible desktop, so nobody can close it, and the process hangs.

Use some other way to get user notified, e.g. send him/her an e-mail, or (if you keep [deprecated] messenger service enabled) run 'net send computer message' command, etc.

Tuesday, February 21, 2012

schedule

I'm running a job from a schedule which runs a .vbs script
In this script I have the following script to include another file
Function GetFileContents(sFileName)
Dim FSO, ScriptFile
Set FSO = CreateObject("Scripting.FileSystemObject")
Set ScriptFile = FSO.OpenTextFile(sFilename,1)
GetFileContents = ScriptFile.ReadAll
Set ScriptFile = Nothing
Set FSO = Nothing
End Function
-> ExecuteGlobal GetFileContents("db_conn.vbs")
When I run the job from sql enterprise manager it stops at the row above
If I run the script from the command line, all is good
What's the problem
Thanks
DenisWhat would you expect the current directory to be when running it from
enterprise manager?
"Microsoft" <dzoddi@.mvmnet.com> wrote in message
news:OjDx0yQ8FHA.1032@.TK2MSFTNGP11.phx.gbl...
> I'm running a job from a schedule which runs a .vbs script
> In this script I have the following script to include another file
> Function GetFileContents(sFileName)
> Dim FSO, ScriptFile
> Set FSO = CreateObject("Scripting.FileSystemObject")
> Set ScriptFile = FSO.OpenTextFile(sFilename,1)
> GetFileContents = ScriptFile.ReadAll
> Set ScriptFile = Nothing
> Set FSO = Nothing
> End Function
> -> ExecuteGlobal GetFileContents("db_conn.vbs")
>
> When I run the job from sql enterprise manager it stops at the row above
> If I run the script from the command line, all is good
> What's the problem
> Thanks
> Denis
>