gunsmokingman Posted September 16, 2005 Share Posted September 16, 2005 The Task schedule seems very hard to do.You have to create the task then delete the task to recreate the task to do what you want. This is my understanding on what I have read about it.Martin would it not be better to start the script as soon as some one logs on.Then you could leave it in a loop that does not end.This loop would keep going because there is no -1Dim Inta : Inta = 1-1Do Inta = Inta + 1'''' Your Action Herewscript.sleep 60000Loop Until Inta = -1The share folder I have no way of testing that. Link to comment Share on other sites More sharing options...
dman Posted September 16, 2005 Share Posted September 16, 2005 Hi Martin,I have been so busy I don't have time to pee. Hope to dig into this over the weekend :-) Link to comment Share on other sites More sharing options...
Martin Zugec Posted September 16, 2005 Author Share Posted September 16, 2005 2Dman: No prob, this is hobby project 2GSM: Nope, that is not good The problem is any error during script will block whole execution, whether batch services are independent on each other + you can create threaded execution...If it is really big problem, I could write it in .NET... Link to comment Share on other sites More sharing options...
gunsmokingman Posted September 16, 2005 Share Posted September 16, 2005 It is kinda of a problem in vbs because as I understand it you must create the task then delete the task. You would have to do this for each task.The loop you could add I believe a way to handle errorsOn Error Resume NextHere is a example of what I meanDim Act, Fso, SD, TestSet Fso = CreateObject("Scripting.FileSystemObject")Set Act = CreateObject("Wscript.shell")SD = Act.ExpandEnvironmentStrings("%systemdrive%")Test = Array("\Test5","\Test4","\Test3","\Test2")For Each StrTest In TestFso.CreateFolder(SD & StrTest)NextAct.Run(SD)MsgBox "Part One Of The Test Completed"On Error Resume NextFso.DeleteFolder(SD &"\Test1")Fso.DeleteFolder(SD &"\Test2")Fso.DeleteFolder(SD &"\Test3")Fso.DeleteFolder(SD &"\Test4")Fso.DeleteFolder(SD &"\Test5")Here Is Another ExampleDim Act, Fso, SD, RunTestSet Fso = CreateObject("Scripting.FileSystemObject")Set Act = CreateObject("Wscript.Shell")SD = Act.ExpandEnvironmentStrings("%systemdrive%")RunTest = Array(_ SD & "\Windows\Notepad.exe",SD & "\Windows\SmokePad.exe",_ SD & "\Windows\System32\Mspaint.exe",SD & "\Windows\System32\Martin.exe")For Each StrRunTest In RunTestIf Fso.FileExists(StrRunTest) ThenAct.Run(StrRunTest),1,TrueAct.Popup "Completed The Test" & vbCrLf & strRunTest, 5, "Completed", 0 + 32ElseAct.Popup "Error In The Test" & vbCrLf & strRunTest, 5, "Error", 0 + 32End IfNext Link to comment Share on other sites More sharing options...
Martin Zugec Posted September 16, 2005 Author Share Posted September 16, 2005 Hmmm, I can see the problem The Win32_ScheduledJob class doesnt support that kind of job I would like to see Looks like we will need to find some workaround...Dman, what do you think, could you create it using C++? I would like to use as less as possible of .NET, because it require runtime Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now