I am creating a database for our new accounting system (Yeah, I know it would have been nice to have it incorporated in the software, but as we all know, promises are for campaigns.) Anyway.
The database is pretty simple. It just creates a new shop order number based on the department, stores the person who took the job out, the department, the shop order number and a few other things in the database. It then calls a batch script to create the directory structure for the job and lastly copies a couple of ISO9000 specific files into that directory.
The batch script is necessary because CACLS is the only way I can create group and user permissions without taking a 2 year Associates Degree in VBA.
At the present I am using "CreateProcessA" which does a fine job of running the bat script to create the directories. My problem is that users must log in as a user with Admin privileges to be able to create and set the proper permissions. I need to users to be able to open the database as themselves and then run the batch file as the specific user.
I've taken a look at and tried both CreateProcessAsUser and CreateProcessWithLoginW. Both of these error out when run. I've come across this little snippet from MS and have decided that having to change every machine in an attempt to fix this process is not acceptable. I've also tried to use CreateProcessA to start RunAs which had the same problem as CreateProcessWithLoginW.
Does anyone have any suggestions? I'm not at all against using a commercial product that contains some libraries for creating Active Directory permissions.
The database is pretty simple. It just creates a new shop order number based on the department, stores the person who took the job out, the department, the shop order number and a few other things in the database. It then calls a batch script to create the directory structure for the job and lastly copies a couple of ISO9000 specific files into that directory.
The batch script is necessary because CACLS is the only way I can create group and user permissions without taking a 2 year Associates Degree in VBA.
At the present I am using "CreateProcessA" which does a fine job of running the bat script to create the directories. My problem is that users must log in as a user with Admin privileges to be able to create and set the proper permissions. I need to users to be able to open the database as themselves and then run the batch file as the specific user.
I've taken a look at and tried both CreateProcessAsUser and CreateProcessWithLoginW. Both of these error out when run. I've come across this little snippet from MS and have decided that having to change every machine in an attempt to fix this process is not acceptable. I've also tried to use CreateProcessA to start RunAs which had the same problem as CreateProcessWithLoginW.
Does anyone have any suggestions? I'm not at all against using a commercial product that contains some libraries for creating Active Directory permissions.