I have a problem with starting a .vbs with an agent procedure. WSCRIPT.EXE does show up in the taskmanager but does not start the script.
If i start the script manual i get the results i want.Even when i start a .bat file the procedure wont start the file.
Part of my procedure:
using the execute file command; I directly call the full path of my update.vbs.
This works perfectly.
If that doesnt work running from a batch might work?
cmd /c runs command prompt hidden.
I made a command that only runs the batch file but doesnt start as well.
Execute the batch file. Make sure to choose coreect option at 'Run As' Logged on user / system account.
What your trying to do is run a batch file from a .vbs script?
Please help me understand the purpose
if you want to run a hidden batch, i can write you an .exe file wich does the job.
Let me know!
Let me explain:
I made a vbscript that looks for available updates on a server, counts them and put that number into a textfile.
The textfile will be created with the following command: Set objFile = objFSO.CreateTextFile("file.txt")
When i start the .vbs with dubbleclick the file creates the txt but when i use the commandline i get a permission denied.
For now i solved the problem by giving the whole path Set objFile = objFSO.CreateTextFile("c:\dir\dir\file.txt")
But that is not the perfect situation
thats weird. Seems like a VB problem.
Maybe create sthe same script in c#?
By the way, did you try using the 'Use credential' in the agent procedure?
Ah I think I understand, when you run the script it creates the file, and the "permission denied" error you are getting is because you did not specify the path so the script will try and create the file in the home path of the user account you are using.
You need to pass variables to your VB script to specify the path and file name so that the VB script can create the file in a path that it has permission to access such as the AgentTempDir (e.g.: c:\kworking) path. If you do it this way then you can specify the path and file name in your Kaseya script.