cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[Problem] VBS,Permission,CustomAction

Hello everybody.
I have a small problem by setting permission or running a custom action script.
Well, I have to change the permission for one ini file so I guess I have to use xcacls.
To run this script I wrote a second one:

Dim WshShell, system_folder, program_path, command

Set WshShell = CreateObject("WScript.Shell")



system_folder = wshShell.ExpandEnvironmentStrings( "%Systemroot%" ) & "\System32\XCACLS.vbs"

program_path = wshShell.ExpandEnvironmentStrings( "%ProgramFiles%" ) & "\IMCOR GmbH\pep\pep.ini /e /g Users:m x l"



command = system_folder & " " & program_path



WshShell.Run command

But the last line will not work. I tried a lot of different versions (Call, True, Exec....) but nada.
So I thought maybe I can just run this vbs script as a kind of exe but also this wont work.

Please, has somebody a idea, I mean it cant be so difficult.

thx for your help
(3) Replies
You could use a new exe - directory table custom action, something like

"[SystemFolder]cmd.exe" /c "cacls [ProgramFilesFolder]IMCOR GmbH\pep\pep.ini /E /G Users:C"
Stephan H. wrote:
Hello everybody.
I have a small problem by setting permission or running a custom action script.
Well, I have to change the permission for one ini file so I guess I have to use xcacls.
To run this script I wrote a second one:

Dim WshShell, system_folder, program_path, command

Set WshShell = CreateObject("WScript.Shell")



system_folder = wshShell.ExpandEnvironmentStrings( "%Systemroot%" ) & "\System32\XCACLS.vbs"

program_path = wshShell.ExpandEnvironmentStrings( "%ProgramFiles%" ) & "\IMCOR GmbH\pep\pep.ini /e /g Users:m x l"



command = system_folder & " " & program_path



WshShell.Run command

But the last line will not work. I tried a lot of different versions (Call, True, Exec....) but nada.
So I thought maybe I can just run this vbs script as a kind of exe but also this wont work.

Please, has somebody a idea, I mean it cant be so difficult.

thx for your help



As stated so often:
Custom actions should be a last resort when all normal featurs cannot be used.
CA's should not be used as a standard procedure.


So: why don't you use the permission table?

reg, Henno
Hi,
at first thanks for your reply.
I am not using the permission table because it is a ini file.
But anyway, I solved by using the old xcacls.exe.
In the command line u just have to take care that u have a space as first character

cu