Link to home
Start Free TrialLog in
Avatar of slb2008
slb2008Flag for United States of America

asked on

Asp.Net State Service Batch File

Dear experts-exchange,

I would like to know how to create a batch file for the ASP.NET State Service, since I don’t want to login to a remote server, to go the administrative tools, services and later re-start the asp.net state service all the time .   That’s a long way to navigate to another server.  I want to have a shortcut batch file in my local pc, so if ASP.net State Service stops, I just click the shortcut and the asp.net state service will re-start without go to another server.  Your assistance and help is appreciated.

Sample batch file like this:

Path remote server ?
net stop "ASP.NET State Service"
net start "ASP.NET State Service"
sc config ?????  start= auto

Thanks.
Avatar of Ted Bouskill
Ted Bouskill
Flag of Canada image

You need to use PowerShell.  It's free from Microsoft and built into Windows 2008 or Windows 7 but has to be installed in older operating systems.  Search the web for PowerShell script sites.  There are LOTS
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
then goto your desktop and create shortcut file.
in the path add the following:

C:\Windows\System32\cscript.exe <script_location>
shortcut properties...
shortcut.jpg
Avatar of slb2008

ASKER

Thanks sedgwick for the script and shortcut properties, but where I will insert your script?  Do I need to create a new vb.net file?
Avatar of slb2008

ASKER

tedbilly,
 
Thanks for your comment. I am familiar with PowerShel, but I don't use the PowerShell very much.  I'll check for the PowerShell scripts. Thanks.
Avatar of slb2008

ASKER

sedgwick:
Sorry I didn't reply you sooner, but I can tell you I create vbs script file using notepad and save the file as remote_proc.vbs on c:\vbs folder and later I created a new shortcut.  Your script and RemoteRestart Properties worked really well.  After created the shortcut on the desktop I clicked it from my machine with good results, so I don't need to login to another server to restart the asp.net service.  Thanks for your help. I appreciated it and you will get 500 points.
slb2008