Restored from previous forum. Originally posted by scurrier.
Some commands to get computer info easy such as:
result$=TotalDriveSpace(drive_letter) gets the total size of drive
result$=FreeDriveSpace(drive_letter) gets the free space of drive
result$=UsedDriveSpace(drive_letter) get the amount used on a drive
result$=servicepack() gets the NT service pack installed
result$=ipaddress(1) gets the ipaddress from network interface card 1
result$=ipaddress(2) gets the ipaddress from network interface card 2
and some commands to make system administration easy such as:
result$=domain() gets the domain name
result$=pdc() gets the PDC server name
result$=bdc() gets the BDC server name
and some commands to add users to groups and permissions to groups
this could make PureBasic more valuable than Perl to System Admins.
on the Windows platform and Linux
thanks
Sean
Commands to do Admin stuff
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by naw.
This would be a huge bonus for me (and I guess many others) Scurrier is right, as a Unix Admin, I can automate _anything_ in a script. Windows is really crappy in this area (and many others - but thats another thread) and like Scurrier says, potentially opens a whole new area for PB.
My concern, though that the range of discreet commands to do this stuff would expand PB enormously, how about taking this approach instead?
Result$=OSinfo("OS", "")
Result$=OSinfo("TotalDriveSpace","C:")
Result$=OSinfo("DriveList","")
Result$=OSadmin("mkuser","Nigel Wale,abc123")
I reckon, the commands could should give a return code of:
0 for success
1 for this function not available on this OS
2 for this function not available in this library
>=3 for command specific failures
What do you think Scurrier?
Then the functionality can be extended without having to extend the PB command set massively.
Is there anyone out there (with a brain the size of a small planet) who can do this, it's out of my league
This would be a huge bonus for me (and I guess many others) Scurrier is right, as a Unix Admin, I can automate _anything_ in a script. Windows is really crappy in this area (and many others - but thats another thread) and like Scurrier says, potentially opens a whole new area for PB.
My concern, though that the range of discreet commands to do this stuff would expand PB enormously, how about taking this approach instead?
Result$=OSinfo("OS", "")
Result$=OSinfo("TotalDriveSpace","C:")
Result$=OSinfo("DriveList","")
Result$=OSadmin("mkuser","Nigel Wale,abc123")
I reckon, the commands could should give a return code of:
0 for success
1 for this function not available on this OS
2 for this function not available in this library
>=3 for command specific failures
What do you think Scurrier?
Then the functionality can be extended without having to extend the PB command set massively.
Is there anyone out there (with a brain the size of a small planet) who can do this, it's out of my league

-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by scurrier.
I think this would be a great start
the more System Admin. commands that are added the more
System Admins. will be switching over to PB from Perl
if the new commands are cross platform between Windows and Linux
there would be less of a reason to use Perl.
I hope to see some of these commands in the future
I havn't used PB very long but I think it's one of the best languages
I have used in a long time.
Thanks
Sean
I think this would be a great start
the more System Admin. commands that are added the more
System Admins. will be switching over to PB from Perl
if the new commands are cross platform between Windows and Linux
there would be less of a reason to use Perl.
I hope to see some of these commands in the future
I havn't used PB very long but I think it's one of the best languages
I have used in a long time.
Thanks
Sean
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by Rings.
Well most of the stuff you needed can been done with the Apis or extended Libs.
Its a long way to the top if you wanna .....CodeGuru
This can been done with API_ and should been complicated as i know.result$=TotalDriveSpace(drive_letter) gets the total size of drive
result$=FreeDriveSpace(drive_letter) gets the free space of drive
result$=UsedDriveSpace(drive_letter) get the amount used on a drive
result$=servicepack() gets the NT service pack installed
result$=ipaddress(1) gets the ipaddress from network interface card 1
result$=ipaddress(2) gets the ipaddress from network interface card 2
What is a PDC or BDC server name ? explain plz.result$=domain() gets the domain name
result$=pdc() gets the PDC server name
result$=bdc() gets the BDC server name
Should been in de NetApiadd users to groups and permissions to groups
Well most of the stuff you needed can been done with the Apis or extended Libs.
Its a long way to the top if you wanna .....CodeGuru