Page 3 of 4 <1234>
Topic Options
#176228 - 2007-05-12 04:06 AM Re: Problem!! [Re: roedie]
Adolfo Offline
Fresh Scripter
*****

Registered: 2007-01-25
Posts: 49
Loc: Cali, CO
For set permissions on sub folders
 Code:
echo. > "c:\program files\infostrait\UserDirs.txt" 

for /R "c:\program files\infostrait" %%i in (.) do echo. %%~si >> "c:\program files\infostrait\UserDirs.txt"

For /F %%i in ("c:\program files\infostrait\UserDirs.txt") do xcacls %%i /E /G  "domain\group":F

Top
#176232 - 2007-05-12 07:06 PM Re: Problem!! [Re: Adolfo]
Adolfo Offline
Fresh Scripter
*****

Registered: 2007-01-25
Posts: 49
Loc: Cali, CO


 Code:
for /R "c:\program files\infostrait" %%i in (.) do xcacls %%~si /E /T /C /G "domain\group":F

Top
#176233 - 2007-05-12 07:21 PM Re: Problem!! [Re: Mart]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Originally Posted By: Mart
It does shout a bit when checking the permissions on the folder that they are not in the correct order.
Are we talking about CACLS or XCACLS? AFAIK, some versions of CACLS has the incorrectly odered ACEs prolem and MS provided a VBS version at one time to fix it. I've never run into the issue on W2K3 using the version of CACLS it provides.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#176238 - 2007-05-14 08:04 AM Re: Problem!! [Re: Les]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
 Originally Posted By: Les
Are we talking about CACLS or XCACLS?


I use XCACLS.

Top
#176239 - 2007-05-14 08:16 AM Re: Problem!! [Re: Mart]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
this code doesnt work:

 Code:
Break on

Shell 'xcacls "c:\program files\infostrait" /E /G "DOMAIN\Werknemers":F;F'


But if i remove the single quotes and Shell (just dos command's):
 Code:
xcacls "c:\program files\infostrait" /E /G "DOMAIN\Werknemers":F;F


Then it runs without any problem.


ahh found it! This code works for me.

 Code:
Break on

Shell 'cmd.exe /c xcacls "c:\program files\infostrait" /E /G "DOMAIN\Werknemers":F;F'


Edited by roedie (2007-05-14 09:08 AM)

Top
#176241 - 2007-05-14 09:33 AM Re: Problem!! [Re: Les]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
 Originally Posted By: Les
 Originally Posted By: Mart
It does shout a bit when checking the permissions on the folder that they are not in the correct order.
Are we talking about CACLS or XCACLS? AFAIK, some versions of CACLS has the incorrectly odered ACEs prolem and MS provided a VBS version at one time to fix it. I've never run into the issue on W2K3 using the version of CACLS it provides.


Xcacls.exe.
I never tried the vbs version.
Xcacls.vbs
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176243 - 2007-05-14 01:36 PM Re: Problem!! [Re: Mart]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
another question.

Do you need to add spcial command lines to let an kix script to run in a startup script of an GPO?

Top
#176244 - 2007-05-14 02:00 PM Re: Problem!! [Re: roedie]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
No. You only have to set it in a GPO and place the script in the sysvol folder.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176246 - 2007-05-14 03:32 PM Re: Problem!! [Re: Mart]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
I have kix32.exe and the script.kix in the netlogon dir.

Now i added blabla\netlogon\kix32.exe to the SCRIPT NAME and blabla\netlogon\script.kix to the SCRIPT PARAMETER
but still it won't work.

i also tried to do blabla\netlogon\kix32.exe to the parameter and the blabla\netlogon\script.kix to the name but that doesnt work neighter.

Top
#176252 - 2007-05-14 03:59 PM Re: Problem!! [Re: roedie]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Setting the script name to \\domain\sysvol\kix32.exe \\domain\sysvol\script.kix should work I guess.
I have to say that I never did anything with batch-less scripts and always used a cmd file to kickoff the script.


Edited by Mart (2007-05-14 04:00 PM)
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176276 - 2007-05-15 09:43 AM Re: Problem!! [Re: Mart]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
maybe i have an another idea.. when you have an msi file you can add it to an gpo.

i know that there is an kix2exe. But is there also an kix to msi ??


Edited by roedie (2007-05-15 09:49 AM)

Top
#176278 - 2007-05-15 09:59 AM Re: Problem!! [Re: roedie]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Nope.
EXE files are executables and MSI files are installers.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176279 - 2007-05-15 10:26 AM Re: Problem!! [Re: Mart]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
hmm ok.. i also tried to run the script as how you said it a couple of post's above. and i tried to start it with an *.bat file. and it still won't work \:\(

Edited by roedie (2007-05-15 10:50 AM)

Top
#176463 - 2007-05-25 08:27 AM Re: Problem!! [Re: roedie]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
i have the script working good now.. but there is still one problem left.

there are 2 files that need to be copyd to the : C:\Documents and Settings\%user%\Application Data\Microsoft\Outlook.

but at the most clients the application data folder is hidden so the script cannot copy the two files.

the sring i use now = COPY "\\server\SmData\ClientSoftware\VB6\OutlookToSmarTeam" "c:\program files\infostrait\OutlookToSmarTeam" /s

is there a way to copy files also in hidden folders without make them visible?

Top
#176477 - 2007-05-25 10:06 AM Re: Problem!! [Re: roedie]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
Kix can copy files to hidden folder. The hidden part is only so the user cannot see and therefore can not mess with the folder. What does @error and @serror show after your copy line?

I guess you ussed @userid insted of %user% right?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#176486 - 2007-05-25 11:18 AM Re: Problem!! [Re: roedie]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
i already found a solution. instead of %userprofile%\application data\ i used %appdata%\ that worked \:\)
Top
#176581 - 2007-05-30 11:04 AM Re: Problem!! [Re: roedie]
roedie Offline
Getting the hang of it

Registered: 2005-11-15
Posts: 52
Loc: balk friesland/holland
I have all the scripts working now.

but still there is one litle problem.

for the startup script i want to let the script read a regkey so if that one exist it will skip the rest of the script.

the script itself in a name.cmd so NOT a kix script.
What is the correct syntax of the if statement in do to see is an key exist?

i tried:
IF EXIST ("HKEY_LOCAL_MACHINE\SOFTWARE\Installed\OutlookTool")
GOTO :end
ELSE

IF EXIST ('HKEY_LOCAL_MACHINE\SOFTWARE\Installed\OutlookTool')
GOTO :end
ELSE

IF EXIST (HKEY_LOCAL_MACHINE\SOFTWARE\Installed\OutlookTool)
GOTO :end
ELSE

IF EXIST HKEY_LOCAL_MACHINE\SOFTWARE\Installed\OutlookTool
GOTO :end
ELSE


But none of those worked.
so if someone has the answer to that plz tell me.

Top
#176586 - 2007-05-30 01:36 PM Re: Problem!! [Re: roedie]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
Use KeyExist()
Also please try to prevent the use of Goto.

 Code:
If KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Installed\OutlookTool")
  ;Do something besides Goto :P
EndIf

Top
#176587 - 2007-05-30 02:12 PM Re: Problem!! [Re: Arend_]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
SELECT / CASE would be a good choice here. Something like:
 Code:
Select
 Case ExistKey("HKLM\first key...")
  ; ok - do nothing
 Case ExistKey("HKLM\second key...")
  ; ok - do nothing again (an again.. as needed)
 Case 1
  ; No required keys were found - do something, install something!
  Shell "%COMSPEC% /c D:\some\app\install.exe /silent /successful"
  ; check for errors {won't be any, chose the successful install option ;)}

EndSelect


Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#176591 - 2007-05-30 03:01 PM Re: Problem!! [Re: Glenn Barnas]
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
 Quote:
GOTO :end

That is just wrong. you define the label with the colon but should not reference it with a colon.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 3 of 4 <1234>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
2 registered (morganw, mole) and 414 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.109 seconds in which 0.038 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org