Post a reply to the thread: VBScript in Vista
Click here to log in
What's the name of our main installation product (in uppercase letters), directly followed by the current year?
You may choose an icon for your message from this list
Will turn www.example.com into [URL]http://www.example.com[/URL].
Re: VBScript in Vista Sharon, Perfect! Thank you for the good news Friedrich
Re: VBScript in Vista
Re: VBScript in Vista Hi Friedrich, I wanted to let you know that I had some success today in setting the permissions for USERS and CREATOR OWNER on a Vista machine. I created a script with the following code: Set objShell = CreateObject("Shell.Application") objShell.ShellExecute "ICACLS.EXE", "C:\Windows\ServiceProfiles\NetworkService\AppData \Local\Temp /grant USERSCI)(S,WD,AD,X)", , ,"runas" objShell.ShellExecute "ICACLS.EXE", "C:\Windows\ServiceProfiles\NetworkService\AppData \Local\Temp /grant ""CREATOR OWNER""OI)(CI)(IO)(F)", , ,"runas" I then used the Set Access Control function as follows: Access Control:Grant File Access "%TMPDIR%\VISTATEST.VBS" It seems to work, at least on my machine. I have Virtual PC installed so I'll try it there as well. There's a lot more work to do in my install but, I feel good about getting over this hurdle. Thanks for all your help, Sharon
Re: VBScript in Vista Sharon, Could you please send your email address to support (at) lindersoft (dot) com. There was a bug in the VBScript processing component. Under certain circumstances, it did not detect the correct VBScript file size. We'll send you an internal new VBScript component. This works fine with the VBScript demo project. Perhaps this will also solve your problem. Friedrich
Re: VBScript in Vista Sharon, Hmm, I just compiled the VBScript demo script for SetupBuilder 6.5 and it does not work. Item in review. Friedrich
Re: VBScript in Vista Hi Friedrich, I'm a little confused, sorry. I need to run these two lines to set the permissions on a Vista machine: icacls %windir%\serviceprofiles\networkservice\AppData\Lo cal\Temp /grant UsersCI)(S,WD,AD,X) icacls %windir%\serviceprofiles\networkservice\AppData\Lo cal\Temp /grant "CREATOR OWNER"OI)(CI)(IO)(F) I'm not sure how to do that. I was thinking that in my script file I could say something like this: Set objShell = CreateObject("Shell.Application") strApplication="ICACLS" strArguments="Windows\serviceprofiles\networkservi ce\AppData\Local\Temp /grant UsersCI)(S,WD,AD,X)" objShell.ShellExecute strApplication, strArguments, "", "runas" Then I could use the Run VBScript function. What do you think? Thanks for all your patience, I sincerely appreciate it. Sharon
Re: VBScript in Vista Hi Sharon, If you use the "Run Program..." script function then the .VBS script is the File Name and Target Folder. Does this help? Friedrich
Re: VBScript in Vista Hi Freidrich, If I wanted to run ShellExecute would I do that from the Run Program Script Function. Using ShellExecute as the File Name and the VBS script would be the Start Parameter? Thanks, Sharon
Re: VBScript in Vista Sharon, I believe there are some source code examples available on MSDN. What you can do is to compile the code from MSDN into your own DLL and then use that from SetupBuilder. Or you could try to create a .vbs and then simply execute it via ShellExecute. Of course, this will only work if WSHLIB is available on the machine! IMO, it's an "overkill" to use WSHLIB to handle access control. Perhaps this helps: http://www.microsoft.com/resources/d....mspx?mfr=true Does this help? Friedrich
Re: VBScript in Vista Hi Freidrich, You mentioned that What I am trying to do (WScript.Shell) is only available in wshom.ocx (WSHLIB). But "Run VBScript" makes use of msscript.ocx, so my code does not work. Is there another scripting function that I should be using. How would I implement WSHLIB? Thanks, Sharon
Re: VBScript in Vista BTW, perhaps "cacls" instead of "icacls" will do the job? Friedrich
Forum Rules