Notification (Execute locally: run a vbs script)

Dude is running as a service.
The Notification should execute a local vbs script:
wscript C:\WriteSMSFile\WriteSMSFile.vbs //B “44999999999” “[Device.Name] [Service.Status] [Service.ProblemDescription]”

The problem is that the script gets only executed as long the control Panel of the dude is running.

Anyone knows a solution for this?

may be you should try to use “start” command, instead wscript directly?
like
start wscript <>

it also may be problem with desktop interaction. try to experiment with service parameters.

thank you for the reply.
I tried with the start command, no difference, the same thing with the dude service (interact with desktop).
I don’t know what i could try else…

Any reason you have the 2 forward slashes in there before the “B” ?
We use server executed notifications constantly with no issues, here is an example of our batch file.

d:\mgmtapps\smssender\smssender.exe username password mobilenumber “Service [Probe.Name] on [Device.Name] ([Device.AddressesCommaList]) [Device.CustomField1] is [Service.Status], Contact: [Device.CustomField3] [Device.CustomField2]]”

This works perfectly and has done for ages, if you run your command from start/run in windows using the identical command as you are trying to use in your batch file, does it work fine ?

We run dude in service mode also, it is possible, although it shouldn’t be required, you may need to set the service to login with a user with higher privilages that systemaccount, just a thought.

Regards
Paul

Two forward slashes, see help wscript.

I can start the script without any problems from the command line, and it works also when the control panel of the dude is open, that confuses me.

started the Service also with an user with admin rights, no difference…

I only just noticed this, have you tried the full path for wscript in the command ?

c:\windows\system32\wscript C:\WriteSMSFile\WriteSMSFile.vbs //B “44999999999” “[Device.Name] [Service.Status] [Service.ProblemDescription]”

I did have a problem with this, you have to have the full path.

Regards
Paul

Thanks Paul for the suggestion.

I also tried this one:
c:\windows\system32\wscript C:\WriteSMSFile\WriteSMSFile.vbs //B “44999999999” “[Device.Name] [Service.Status] [Service.ProblemDescription]”

Sadly the same result, script is working when the dude is open but when it’s closed, nothing happens.

Are you running the dude server and client on the same machine ?
Are you running dude server as an application or service ?

Regards
Paul

Are you running the dude server and client on the same machine ?
Yes
Are you running dude server as an application or service ?
As a Service

But the script gets only executed when i launch dude as an application.

Does anyone know a other way to write a text file?
I also tried with echo bla bla bla >sms.txt but this didn’t work either. That was the reason i wrote a vbs script which save the arguments to a text file.

Seriously ?, use notepad or wordpad

Paul

lol pjulian :slight_smile:

please repeat your objective in simple words - what do you need to write to file, and why?

@pjulian good joke:-(

I would like to send a sms with SMS Server Tools 3, for this to work i need to place a text file with [Device.Name] [Service.Status] [Service.ProblemDescription] in a folder.

Sorry, I had to dig :slight_smile:

So when a device goes down, you want to create a text file with certain information in it to use as a config/parameters file for your SMS sending application, is that correct ?

If so, do they have to be on separate lines or simply one after the other or comma separated etc ?

Do you have any example of a format that actually works, excluding The Dude in this instance ?

Regards
Paul

@Paul no problem

The format of the sms textfile should look like this (3 Lines: Nr, empty, smstext):

To: 491721234567

Hello, this is the sms.

OK, i worked it out:

  1. Run dude in administrator mode (right click, run as administrator)
  2. Then dude will be able to run tools like this:
cmd.exe /k echo [Device.FirstAddress] > test.txt

Same Problem as I described in my first post.
It only works when you run dude as an application but it should also work when dude is running as a service.

Good one Normis, not a bad solution, however, I would probably do it slightly differently, but I suppose it would achieve the same result at the end of the day.

Create a batch file called whatever you want, lets say SMS.BAT or SMS.CMD, whichever you prefer.
In The Dude, make your alert command like this “SMS.BAT [Device.Name] [Service.Status] [Service.ProblemDescription]”
The the contents of the batch file could be:

DRIVE:\PATH\smsprogram.exe mobilenumber %1 %2 %3

Plus whatever other info you need in there.

Running a batch file definately works as I use that method for alerts, that is in V2.2 anyway running as a service.

This is of course assuming you can do it without your text file and just from the command line, I would imagine so.

Regards
Paul

Sadly the same problem.
I tried to start a batch file (without any arguments) which would do the following:
echo "to:41123456789) >c:\sms\smstext.txt

I can start the batch file from command line without any problem but it stops working after i run dude as a service(tested on two different dude systems).

Yes Paul, i can start a Batch file, for example i Force the Update Detection from Automatic Update, which wouldn’t make any sense for notification, but it’s only a test.
Content of the Batch file:
wuauclt /detectnow

You can see that wuauclt.exe appears as a process.

This works when dude is running as a service, but as soon i’m trying to write to a file, nothing happens.

What permissions is the dude service running with? Admin rights or is it running with different permissions? Could there be permissions errors with it writing to the file? Have you looked to see if there are any errors in the system’s Error Log?