It is currently Sun Dec 15, 2019 1:17 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 105 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 12, 2017 9:27 pm 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
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"


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 12, 2017 9:49 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
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:
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.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 12, 2017 10:56 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue May 28, 2013 10:51 pm
Posts: 539
Location: Europe
Hi JHPJHP,

your Dropbox reports 429 generating too much traffic. :( Do you have alternative repository, GitHub or something similar?

_________________
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 12, 2017 11:10 pm 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
Thank you very much JHP, it's excellent!


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Fri Jan 13, 2017 1:24 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
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.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Fri Jan 13, 2017 1:49 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 04, 2015 7:10 am
Posts: 1673
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>

_________________
Thankyou to all the coders who generously helped & encouraged me in the nearly 2yrs when i was welcome here,
it was a tremendous privilege. I learned a lot. I wish you and your families all the best and success for the future.


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sat Jan 14, 2017 12:46 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
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)

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Sun Jan 15, 2017 1:41 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sat Jan 14, 2017 6:41 pm 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
just one more question, how can i delete all restore points?


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sat Jan 14, 2017 11:53 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
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:
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

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Jan 15, 2017 12:02 am 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
Much Thanks

i add a procedure in your file

Code:
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


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Jan 15, 2017 1:22 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Updated Stuff\RestorePoints\PS_RestorePoints.pbi
- added 1 Procedure: DeleteRestorePoints(RestorePoints.s)

Delete all restore points:
Code:
RestorePoints.s = ListRestorePoints()
DeleteRestorePoints(RestorePoints)

Delete known restore points:
Code:
DeleteRestorePoints("5,6,7")

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Jan 15, 2017 6:26 am 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
Thank you very much, it's excellent!

Edit: but the server doesn't work


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Jan 15, 2017 10:47 am 
Offline
Addict
Addict
User avatar

Joined: Tue Oct 09, 2007 2:15 am
Posts: 1093
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.

_________________
PureBasic 5.71 LTS (Windows x86/x64) | Windows10 Pro x64 | Z370 Extreme4 | i7 8770k | 32GB RAM | iChill GeForce GTX 980 X4 Ultra | HAF XF Evo​​
English is not my native language... (I often use DeepL to translate my texts.)


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Wed Jan 18, 2017 6:50 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
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 will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 19, 2017 1:10 am 
Offline
User
User

Joined: Fri Feb 05, 2016 10:11 am
Posts: 73
Thank you JHP for your wonderfull work


Envoyé de mon iPhone en utilisant Tapatalk


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 105 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 10 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye