Adding Service with Srvany

Joined
Oct 28, 2009
Messages
10
Reaction score
0
Hello to all, :)

I'm currently having a problem with regards to adding a service using srvany, I really dont know how.. I know I must use instsrv.exe with that.. I already tried it and I can see the service is already at services.msc. However, it automatically stops immediately after I press start. I am using vbs.
Just to clarify:

1) can we add a vbscript as service
2) if yes, how?
3) do we have to edit the registry.. also how?

:D I have so many questions in mind.. I have seen .vbs running at startup.. but i dont really understand how to do the same.


Thank you very much!

Jb
 
Joined
Oct 28, 2009
Messages
10
Reaction score
0
Create Copy and Register....

I've done it.. but not as service.. I have created a script that would loop infinitely until the computer restarts.. add a registry of that file into HKLM and run it at startup. Worked great!:nod:
 
Joined
Apr 19, 2008
Messages
4,081
Reaction score
1
jbconnection said:
I've done it.. but not as service.. I have created a script that would loop infinitely until the computer restarts.. add a registry of that file into HKLM and run it at startup. Worked great!:nod:


Good going, glad you got it sorted then. And thanks for posting back to let us know you have solver your problem, now at least if anybody else has the same problem they can come to you for an answer..

Sorry nearly forgot me manners. Welcome to the forum mate.
happywave.gif
happywave.gif
happywave.gif

 
Joined
Oct 28, 2009
Messages
10
Reaction score
0
By the way.. here's a part of the setup script I used to run the vbs at start up
---------------------------------------------------------------------------
Set winShell = Wscript.CreateObject("Wscript.Shell")
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = winShell.ExpandEnvironmentStrings( "%COMPUTERNAME%" )
Set objRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
strValueName = "MyScript"

strStringValue="C:\ProgramFiles\MyScripts\MyScript.vbs"
objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, strStringValue

RestartPC
---------------------------------------------------------------------------
Have Fun.
 
Joined
Jul 3, 2008
Messages
407
Reaction score
0
Services don't run continuously... they do end if not coded to restart or wait.
Secondly, it would have to be a mighty big vbs script for you to see it run.

The majority of services are listeners where they just wait untill an external source commands them to do something.... these are the ones you see running (as well as the ones doing stuff).

My main concern is that you've created a forever loop... many programmers will slap your hands and say bad JBC. Unless you've put an awfull lot of tidy up code in there that system will get slower and slower and slower.

Things to note about forever loops....
- memory registers - allocated registers aren't always reused/tidied.
- drive fragmentation - any writing of the drive.
 
Joined
Feb 16, 2009
Messages
2,123
Reaction score
18
Forgive me if this sounds silly but can ya not turn the loop off and clean up and defrag and then turn the loop back on again.....sort of like a pitstop for maintenance task ???
Also why will the sytem get slower and slower....i'm just curious cos i'm still learning, also i'm el dopo.
 
Joined
Oct 28, 2009
Messages
10
Reaction score
0
oh i see.. thanks JaLing.. i am coding a some sort of maintenance program that will force a computer to restart after 15 days of continuous use.. It will also contain a module that will delete temp files if the harddisk free space is less than 15%.. currently I've been testing the script for three days and it already consumed 11mb of memory..
 
Joined
Oct 28, 2009
Messages
10
Reaction score
0
Initially, the script (wscript.exe) would only consume 3mb of space at startup.. I wonder how would I get around with this... hmmmmmm...:lol:
 
Joined
Oct 28, 2009
Messages
10
Reaction score
0
I'm thinking if I could use another script to stop and re-run the main script.. Is that going to clear the previous memory consumed by the script?...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top