paulwhelan
asked on
Adding a VB 'Job' in SQL Enterprise Manager
Hi
I added a Job in Enterprise manager and this is the script
set FSO = server.createobject("Scrip ting.FileS ystemObjec t")
set filewriter = FSO.createtextfile("d:/you rdirectory /yourfile. html")
filewriter.writeline "hello world"
set fso = nothing
set filewriter = nothing
And I set it to run every minute.
However
1 - nothing was created on my harddisk
2 - i cant seem to go back to edit or view the job?
thanks
I added a Job in Enterprise manager and this is the script
set FSO = server.createobject("Scrip
set filewriter = FSO.createtextfile("d:/you
filewriter.writeline "hello world"
set fso = nothing
set filewriter = nothing
And I set it to run every minute.
However
1 - nothing was created on my harddisk
2 - i cant seem to go back to edit or view the job?
thanks
set filewriter = FSO.createtextfile("d:/you rdirectory /yourfile. html")
should also be:
set filewriter = FSO.createtextfile("d:\you rdirectory \yourfile. html")
should also be:
set filewriter = FSO.createtextfile("d:\you
See my comment in the related question:
"check if a website is 'live'"
[ https://www.experts-exchange.com/questions/21871271/check-if-a-website-is-'live'.html ]
===
Take your VBScript you pasted above & place it in a distinct file external to Enterprise Manager (and give it a ".vbs" extension).
Now set Enterprise Manager to run this .vbs file instead ("Execute Process Task" -> Set "Win32 Process" to be the full folder path/filename where you have saved the .vbs file).
Once you have this working we can look at re-coding the above suggestions in VBScript, rather than in VB(A) as they are shown in the previous comments.
===
BFN,
fp.
"check if a website is 'live'"
[ https://www.experts-exchange.com/questions/21871271/check-if-a-website-is-'live'.html ]
===
Take your VBScript you pasted above & place it in a distinct file external to Enterprise Manager (and give it a ".vbs" extension).
Now set Enterprise Manager to run this .vbs file instead ("Execute Process Task" -> Set "Win32 Process" to be the full folder path/filename where you have saved the .vbs file).
Once you have this working we can look at re-coding the above suggestions in VBScript, rather than in VB(A) as they are shown in the previous comments.
===
BFN,
fp.
ASKER
Hi fanpages
Where is "Execute Process Task"?
Should I do
Tools
Job Scheduling?
If I do that it gives me three options
TSQL command
Operating system shell command (eg run a batch script or invoke an application)
Active script (vbscript or javascript)
If I select Operation system shell command
it says
"type the Operating system shell command you want this job to execute"
What do I type here?
Thanks
Paul
Where is "Execute Process Task"?
Should I do
Tools
Job Scheduling?
If I do that it gives me three options
TSQL command
Operating system shell command (eg run a batch script or invoke an application)
Active script (vbscript or javascript)
If I select Operation system shell command
it says
"type the Operating system shell command you want this job to execute"
What do I type here?
Thanks
Paul
ASKER
angel
Thanks
Im trying
set filewriter = FSO.createtextfile("d:\you rdirectory \yourfile. html")
now
So i will let you know
Also is there a way to view / edit old jobs?
I cant seem to find the ones i created
Thanks
Im trying
set filewriter = FSO.createtextfile("d:\you
now
So i will let you know
Also is there a way to view / edit old jobs?
I cant seem to find the ones i created
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
angel
That didn't seem to work either
Would there be a simple insert i could do into my database instead of the 'write to d:'
thanks
paul
That didn't seem to work either
Would there be a simple insert i could do into my database instead of the 'write to d:'
thanks
paul
set FSO = server.createobject("Scrip ting.FileS ystemObjec t")
should it be
set FSO = wscript.createobject("Scri pting.File SystemObje ct")
should it be
set FSO = wscript.createobject("Scri
set filewriter = FSO.createtextfile("d:/you
filewriter.writeline "hello world"
filewriter.close
set fso = nothing
set filewriter = nothing
where is the drive D: (ie is it a local harddisk)
is the sql server local on your computer or on a remote server?
2) well, possibly you didn't create the job correctly, hence was not saved, hence did not run.