Hi everybody,
Just wanted to know; is there any way to restart NAS service from codeunit. If yes then please guide me up;
i have another query as well; i am reading an XML message from MSMQ through NAS and then i m writing tht XML to a file; suddenly due to any error the process gets terminated and file gets locked; now the next time when i would run that file it gives me that LOCKING error. I dont know whts the work around of tht issue.
Thanks in Advance,
Regards
0
Comments
-or you can use pskill (www.sysinternals.com) to kill the nas. And if you put in the services properties that the service must be restarted if killed, it will restart automatically after the kill.
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I know how to restart service from Windows run , but i want to restart that service from Navision Codeunit, i hope you getting me.
Thanks in Advance,
Regards
SHELL(TXTCOMANDO, TXTPARAMETRO);
Where TXTCOMANDO = "%systemroot%\system32\Command.com" and TXTPARAMETRO = "/c Net start NASNAME" or "/c Net stop NASNAME"
-- Alejandro --
http://www.mibuso.com/forum/viewtopic.php?t=12417
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
I used this code to re-start NAS automatically. But I was getting the message "For security reason you are not allow to run following executabels in the shell function when it is passed as a variable".
I am not sure if I have to do or write some other code to run this command.
Please suggest.
Regards
Mini
So a little tip&trick:
If your NAS is on a other machine and you need to stop him from a other machine which runs the Codeunit, like a Client, you can use the psservice.exe. Also if the nas is on the same machine i use psservice to query the state ...
So, with following little code you can start / stop / ask for state a service.
Regards