Calling CasPol tool using Shell commands from VB code does not work on some computers? 
Author Message
 Calling CasPol tool using Shell commands from VB code does not work on some computers?

HI, I have a problem.  I need to call CasPol tool from VB code to give
appropriate security permissions to my app.  For that I use ShellEx API
Functionality.  My code is as follows:

        Dim startInfo As New ProcessStartInfo("caspol.exe")
                ' The default for UseShellExecute is false. If this is not
set an exception would be
                ' thrown when the start method is executed.
        startInfo.UseShellExecute = True
        startInfo.WorkingDirectory =
"%windir%\Microsoft.NET\Framework\v1.0.3705\"
                ' Provide the needed arguements to create security
permissions.
        startInfo.Arguments = "-machine -addgroup LocalIntranet_Zone -url
http://some_or_other/* FullTrust -name Workstation_Access -description
some_app"
        Process.Start(startInfo)

The problem I ran upon is that since I have Visual Studio/Full .Net
FrameworkSDK installed on my machine I can run caspol tool from command
prompt just by typing CasPol.  On the other hand, on clients where
Redistributable Framework (20Mb) is installed I cannot do that, I have to go
to the directory where CasPol is located before running it, which I attempt
to do in my code by setting WorkingDirectory.  When I run this code on a
client (I use it on install in my setup package) it does not execute, while
executing just fine on my machine.

Any help is greatly appreciated...

Sincerely,
Oleg



Sat, 17 Sep 2005 05:14:54 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. This can be done by using the Visual Basic Shell command

2. Shell command not working...Please help

3. Shell command not working...NEED HELP!!!!

4. Shell command not working

5. shell command with space in path/file name does not work

6. shell command with space in path/file name does not work

7. Shell Code Not working!

8. Program not closing using Shell command

9. Shell command in VB not updating filelist box

10. Using Scripting.Shell Exec command to capture the results of a SFTP ls command

11. Running DOS Shell in hidden window, or using vb command instead

12. Simulating NET SEND in a VB Program without using SHELL commands

 

 
Powered by phpBB® Forum Software