Windows Services & Other Stuff
Re: Services, Stuff, and Shellhook
Thank you very much for your help, but still when i restart the computer, all services restart.
I need a command to do the "net stop"
I need a command to do the "net stop"
Re: Services, Stuff, and Shellhook
Updated the SERVICES section of the package.
- added Constants
- fixed Structures, Procedures
- renamed 1 example
-- CreateService_x86.pb to CreateService.pb
NB*: With the above changes the CreateService.pb example now works in both the 32 bit and 64 bit IDE (compiler).
---------------------------------------------------------------------
Hi boyoss,
After stopping a service you need to disable it, if you don't want the service to restart when the computer reboots.
- setting it to Manual (#SERVICE_DEMAND_START) may not stop the OS from restarting it
NB*: The NET Stop command is the same as the ServiceStop Procedure, and wouldn't prevent the service from restarting when the computer rebooted.
- added Constants
- fixed Structures, Procedures
- renamed 1 example
-- CreateService_x86.pb to CreateService.pb
NB*: With the above changes the CreateService.pb example now works in both the 32 bit and 64 bit IDE (compiler).
---------------------------------------------------------------------
Hi boyoss,
After stopping a service you need to disable it, if you don't want the service to restart when the computer reboots.
- setting it to Manual (#SERVICE_DEMAND_START) may not stop the OS from restarting it
Code: Select all
ServiceStop(ServiceName)
ServiceStartup(ServiceName, #SERVICE_DISABLED)
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
Hi JHPJHP,
your Dropbox reports 429 generating too much traffic.
Do you have alternative repository, GitHub or something similar?
your Dropbox reports 429 generating too much traffic.

Re: Services, Stuff, and Shellhook
Thank you very much JHP, it's excellent!
Re: Services, Stuff, and Shellhook
Hi bbanelli,
---------------------------------------------------------------
Hi boyoss,
You're welcome, I'm glad it worked for you.
Thank you for the heads-up. Unfortunately, I have no other repository setup. I will check back tomorrow, if there is still a problem I will look into another means of distributing the files.Dropbox wrote:Error (429)
This account's links are generating too much traffic and have been temporarily disabled!
---------------------------------------------------------------
Hi boyoss,
You're welcome, I'm glad it worked for you.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
in regards to a stopped service automatically restarting, when you use Control Panel -> Services and right-click Stop a service it doesn't automatically restart, so I wonder if there's a #DONTRESTART kinda flag that can be used, or if it temporarily Disables it for a few seconds!? no idea sorry </useful contribution>
Re: Services, Stuff, and Shellhook
Updated the Stuff folder:
- added 1 include
-- PS_RestorePoints.pbi
- added 1 example
-- PS_CreateShowDelete.pb
Using PowerShell the following Procedures have been created to access the Windows System Restore Points.
- PS_RestorePoints.pbi (CreateRestorePoint, ListRestorePoints, GetExecutionPolicy, SetExecutionPolicy, DeleteRestorePoints)
- added 1 include
-- PS_RestorePoints.pbi
- added 1 example
-- PS_CreateShowDelete.pb
Using PowerShell the following Procedures have been created to access the Windows System Restore Points.
- PS_RestorePoints.pbi (CreateRestorePoint, ListRestorePoints, GetExecutionPolicy, SetExecutionPolicy, DeleteRestorePoints)
Last edited by JHPJHP on Sun Jan 15, 2017 1:41 am, edited 1 time in total.
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
just one more question, how can i delete all restore points?
Re: Services, Stuff, and Shellhook
Hi boyoss,
The simplest way using the existing IncludeFile is to iterate through the sequence numbers.
- replace the code in the example PS_CreateShowDelete.pb with the following script:
NB*: Only 1 restore point can be created every 24 hours using the PowerShell method... See: Checkpoint-Computer
The simplest way using the existing IncludeFile is to iterate through the sequence numbers.
- replace the code in the example PS_CreateShowDelete.pb with the following script:
Code: Select all
IncludeFile "PS_RestorePoints.pbi"
PS_Description.s = "test_2017"
CreateRestorePoint(PS_Description)
RestorePoints.s = ListRestorePoints()
Debug RestorePoints : #DELETE_ALL = #True
If #DELETE_ALL
Define.s dwEventType
For rtnCount = 1 To CountString(RestorePoints, #LF$)
dwEventType = StringField(RestorePoints, rtnCount, #LF$)
nSearch1 = FindString(dwEventType, "BEGIN_SYSTEM")
nSearch2 = FindString(dwEventType, "END_SYSTEM")
nSearch3 = FindString(dwEventType, "BEGIN_NESTED")
nSearch4 = FindString(dwEventType, "END_NESTED")
Select #True
Case Bool(nSearch1), Bool(nSearch2), Bool(nSearch3), Bool(nSearch4)
PS_Sequence = Val(Mid(dwEventType, 50, 22))
DeleteRestorePoint(PS_Sequence)
EndSelect
Next
Else
intStart = FindString(RestorePoints, PS_Description)
If intStart
intStart + Len(PS_Description) + 1
intLength = FindString(RestorePoints, "BEGIN_SYSTEM", intStart) - intStart
PS_Sequence = Val(Mid(RestorePoints, intStart, intLength))
DeleteRestorePoint(PS_Sequence)
EndIf
EndIf
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
Much Thanks
i add a procedure in your file
i add a procedure in your file
Code: Select all
Procedure DeleteAllRestorePoint()
Define.s dwEventType
Define.s RestorePoints
RestorePoints.s = ListRestorePoints()
For rtnCount = 1 To CountString(RestorePoints, #LF$)
dwEventType = StringField(RestorePoints, rtnCount, #LF$)
nSearch1 = FindString(dwEventType, "BEGIN_SYSTEM")
nSearch2 = FindString(dwEventType, "END_SYSTEM")
nSearch3 = FindString(dwEventType, "BEGIN_NESTED")
nSearch4 = FindString(dwEventType, "END_NESTED")
Select #True
Case Bool(nSearch1), Bool(nSearch2), Bool(nSearch3), Bool(nSearch4)
PS_Sequence = Val(Mid(dwEventType, 50, 22))
DeleteRestorePoint(PS_Sequence)
EndSelect
Next
EndProcedure
Re: Services, Stuff, and Shellhook
Updated Stuff\RestorePoints\PS_RestorePoints.pbi
- added 1 Procedure: DeleteRestorePoints(RestorePoints.s)
Delete all restore points:
Delete known restore points:
- added 1 Procedure: DeleteRestorePoints(RestorePoints.s)
Delete all restore points:
Code: Select all
RestorePoints.s = ListRestorePoints()
DeleteRestorePoints(RestorePoints)
Code: Select all
DeleteRestorePoints("5,6,7")
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
Thank you very much, it's excellent!
Edit: but the server doesn't work
Edit: but the server doesn't work
Re: Services, Stuff, and Shellhook
I have the same problem with my dropbox account, nearly two years.bbanelli wrote:Hi JHPJHP,
your Dropbox reports 429 generating too much traffic.![]()
I can change this state only, if I change to a "Premium" account....
I think you have now the same problem JHPJHP.
Re: Services, Stuff, and Shellhook
Hi bbanelli, Bisonte,
I've updated the download links, replacing Dropbox with OneDrive.
------------------------------------------------------
Updated:
- added 1 example to the Stuff folder
-- OtherStuff\FileSecurity.pb
This example adds explicit permissions (removes inheritance) using a variety of methods.
I recently read this post about problems setting permissions / renaming a file located in the System32 folder, and wanted to see if a modified version of the script I used for Network Share Management Functions resolved this.
NOTE (tested in Windows 10):
- changing permissions in the System32 folder requires the 64bit IDE, otherwise permissions are changed to the matching file in the SysWOW64 folder
-- must set Request Administrator mode for Windows Vista and above from Compiler Options
NB*: Request Administrator mode for Windows Vista and above is not required for files located outside a protected folder (64bit IDE not required outside the System32 folder).
I've updated the download links, replacing Dropbox with OneDrive.
------------------------------------------------------
Updated:
- added 1 example to the Stuff folder
-- OtherStuff\FileSecurity.pb
This example adds explicit permissions (removes inheritance) using a variety of methods.
I recently read this post about problems setting permissions / renaming a file located in the System32 folder, and wanted to see if a modified version of the script I used for Network Share Management Functions resolved this.
NOTE (tested in Windows 10):
- changing permissions in the System32 folder requires the 64bit IDE, otherwise permissions are changed to the matching file in the SysWOW64 folder
-- must set Request Administrator mode for Windows Vista and above from Compiler Options
NB*: Request Administrator mode for Windows Vista and above is not required for files located outside a protected folder (64bit IDE not required outside the System32 folder).
If you're not investing in yourself, you're falling behind.
My PureBasic Stuff ➤ FREE STUFF, Scripts & Programs.
My PureBasic Forum ➤ Questions, Requests & Comments.
Re: Services, Stuff, and Shellhook
Thank you JHP for your wonderfull work
Envoyé de mon iPhone en utilisant Tapatalk
Envoyé de mon iPhone en utilisant Tapatalk