Page 4 of 14
Re: Services, Stuff, and Shellhook
Posted: Thu Jan 12, 2017 9:27 pm
by boyoss
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"
Re: Services, Stuff, and Shellhook
Posted: Thu Jan 12, 2017 9:49 pm
by JHPJHP
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
Code: Select all
ServiceStop(ServiceName)
ServiceStartup(ServiceName, #SERVICE_DISABLED)
NB*: The
NET Stop command is the same as the
ServiceStop Procedure, and wouldn't prevent the service from restarting when the computer rebooted.
Re: Services, Stuff, and Shellhook
Posted: Thu Jan 12, 2017 10:56 pm
by bbanelli
Hi JHPJHP,
your Dropbox reports 429 generating too much traffic.
Do you have alternative repository, GitHub or something similar?
Re: Services, Stuff, and Shellhook
Posted: Thu Jan 12, 2017 11:10 pm
by boyoss
Thank you very much JHP, it's excellent!
Re: Services, Stuff, and Shellhook
Posted: Fri Jan 13, 2017 1:24 am
by JHPJHP
Hi bbanelli,
Dropbox wrote:Error (429)
This account's links are generating too much traffic and have been temporarily disabled!
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.
---------------------------------------------------------------
Hi boyoss,
You're welcome, I'm glad it worked for you.
Re: Services, Stuff, and Shellhook
Posted: Fri Jan 13, 2017 1:49 am
by Keya
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
Posted: Sat Jan 14, 2017 12:46 am
by JHPJHP
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)
Re: Services, Stuff, and Shellhook
Posted: Sat Jan 14, 2017 6:41 pm
by boyoss
just one more question, how can i delete all restore points?
Re: Services, Stuff, and Shellhook
Posted: Sat Jan 14, 2017 11:53 pm
by JHPJHP
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:
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
NB*: Only 1 restore point can be created every 24 hours using the PowerShell method...
See:
Checkpoint-Computer
Re: Services, Stuff, and Shellhook
Posted: Sun Jan 15, 2017 12:02 am
by boyoss
Much Thanks
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
Posted: Sun Jan 15, 2017 1:22 am
by JHPJHP
Updated
Stuff\RestorePoints\PS_RestorePoints.pbi
- added 1 Procedure:
DeleteRestorePoints(RestorePoints.s)
Delete all restore points:
Code: Select all
RestorePoints.s = ListRestorePoints()
DeleteRestorePoints(RestorePoints)
Delete known restore points:
Re: Services, Stuff, and Shellhook
Posted: Sun Jan 15, 2017 6:26 am
by boyoss
Thank you very much, it's excellent!
Edit: but the server doesn't work
Re: Services, Stuff, and Shellhook
Posted: Sun Jan 15, 2017 10:47 am
by Bisonte
bbanelli wrote:Hi JHPJHP,
your Dropbox reports 429 generating too much traffic.
I have the same problem with my dropbox account, nearly two years.
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
Posted: Wed Jan 18, 2017 6:50 pm
by JHPJHP
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).
Re: Services, Stuff, and Shellhook
Posted: Thu Jan 19, 2017 1:10 am
by boyoss
Thank you JHP for your wonderfull work
Envoyé de mon iPhone en utilisant Tapatalk