home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Encyclopedia 96-1
/
novell-nsepro-1996-1-cd2.iso
/
download
/
netware
/
an401x.exe
/
UNINSTAL.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-23
|
3KB
|
96 lines
/*
████████████████████████████████████████████████████████████████████████████
█ █
█ uninstal.c █
█ █
█ Uninstall job server and job queue created by install.exe █
█ █
████████████████████████████████████████████████████████████████████████████
*/
#include <stdio.h>
#include <stdlib.h>
#include <nwcalls.h>
#include <nwerror.h>
#include "..\doit.h"
#define NWDOS
void main()
{
DWORD queueID;
NWCCODE cCode;
NWCONN_HANDLE connID;
NWCONN_NUM connNumber;
char userName[48];
char serverName[48];
cCode = NWCallsInit(NULL, NULL);
if (cCode != SUCCESSFUL) {
printf("Unable to initialize NetWare interface\n");
exit(-1);
}
/* get the connection ID of the server that we're uninstalling from */
cCode = NWGetDefaultConnectionID(&connID);
if (cCode != SUCCESSFUL) {
printf("Unable to get connection ID of default server\n");
exit(-1);
}
/* get the name of the default server */
cCode = NWGetFileServerName(connID, serverName);
if (cCode != SUCCESSFUL)
printf("Unable to get file server name\n");
else {
/* delete DOIT_ACCT_SERV property of server object */
cCode = NWDeleteProperty(connID, serverName, OT_FILE_SERVER, "DOIT_ACCT_SERV");
if (cCode == SUCCESSFUL)
printf("Deleted DOIT_ACCT_SERV property from file server object\n");
else
printf("Unable to delete DOIT_ACCT_SERV property from file server object\n");
}
/* delete the job server object */
cCode = NWDeleteObject(connID, JOBSERV_NAME, OT_DOIT);
if (cCode == SUCCESSFUL)
printf("Deleted job server object\n");
else
printf("Call to NWDeleteObject failed, cCode = %X\n", cCode);
/* get the object ID of the queue */
cCode = NWGetObjectID(connID, JOBSERV_NAME, OT_DOIT_Q, &queueID);
if (cCode != 0) {
printf("Call to NWGetObjectID failed, cCode = %X\n", cCode);
} else {
/* delete the queue */
cCode = NWDeleteObject(connID, JOBSERV_NAME, OT_DOIT_Q);
if (cCode == SUCCESSFUL)
printf("Deleted job queue object\n");
else
printf("Call to NWDeleteObject failed, cCode = %X\n", cCode);
}
/* get your connection number */
cCode = NWGetConnectionNumber(connID, &connNumber);
if (cCode != 0)
printf("Unable to get your connection number to default server\n");
else {
/* get your user name */
cCode = NWGetConnectionInformation(connID, connNumber, userName, NULL, NULL, NULL);
if (cCode != 0) {
printf("Unable to get your user name\n");
exit(-1);
} else {
/* delete your user's DOIT_ACCT_BAL property */
cCode = NWDeleteProperty(connID, userName, OT_USER, "DOIT_ACCT_BAL");
if (cCode == SUCCESSFUL)
printf("Deleted user's DOIT_ACCT_BAL property\n");
else
printf("Unable to delete user's DOIT_ACCT_BAL property\n");
}
}
printf("Job server uninstalled\n");
}