mvandek2
(Fresh Scripter)
2003-12-15 01:30 PM
no right to set wallpaper

I try to set the wallpaper on windows 2000 en XP clients with this code:

$foto="foto.bmp"
If NOT Exist ("c:\winnt\"+$foto)
Copy @lserver+"\fotos\"+$foto "c:\winnt\"+$foto
EndIf
SetWallpaper ($foto,1)

This doesn't work because the file doesn't get copied to the client, a permissions question. Can the setwallpaper() function only work if you have local admin rights?


JochenAdministrator
(KiX Supporter)
2003-12-15 01:37 PM
Re: no right to set wallpaper

what happens when you try with this line instead :

Copy @lserver+"\fotos\"+$foto "c:\winnt\"


mvandek2
(Fresh Scripter)
2003-12-15 01:44 PM
Re: no right to set wallpaper

Hi Jochen,

No use, problem is that I cannot write in clients Winnt directory.

I tried, when logged in as a user, to browse to the file on the server and copy it in the Winnt directory which also fails.


Wizard
(Hey THIS is FUN)
2003-12-15 02:40 PM
Re: no right to set wallpaper

The wallpaper file does not have to be in the winnt folder.

Put it somewhere else, for example C:\Program Files\ and set the wallpaper from there.

To 'hide' it from the users, you could copy it to a path that is quite deep.

W


mvandek2
(Fresh Scripter)
2003-12-15 03:27 PM
Re: no right to set wallpaper

Yeah, that is probably best.

Thanks


Sealeopard
(KiX Master)
2003-12-15 03:52 PM
Re: no right to set wallpaper

This is a permissions problem, as by default, regular users are not allowed to write to %WINDIR%. I would copy the files via a central admin script to the clients.
Code:

; prototype code
$comps=comnetview()
for each $comp in $comps
copy '\\server\share\file.bmp' '\\'+$comp+'\c$\winnt\'
next



mvandek2
(Fresh Scripter)
2003-12-15 04:06 PM
Re: no right to set wallpaper

Thanks!

So comnetview is a UDF. What is this and why are they not mentioned in the manual or function reference?



Sealeopard
(KiX Master)
2003-12-15 04:09 PM
Re: no right to set wallpaper

See the FAQ Forum under How to write a UDF and How to use UDFs

mvandek2
(Fresh Scripter)
2004-02-07 12:18 PM
Re: no right to set wallpaper

It seems that the server doesn't have rights in any map on the clients. I just can't copy the bitmap.

This will also be a problem then with "addprinterconnection" when copying driver files.

This brings me to another thing I cannot find an answer for:

"When Windows NT connects to the printer, it may copy printer driver files to the local computer."

If the drivers are not known to the clients and server OS where does it get the drivers from? Should you install the printer at least on the server, is that the idea?

(I like to do it all without UDF's)

Mark


Sealeopard
(KiX Master)
2004-02-07 03:22 PM
Re: no right to set wallpaper

Please show the code you use to copy the file to the clients.

I also assume you're referring to the ADDPRINTERCONNECTION() function? Please learn to provide precise and meaningful posts as described in ABC's of KiXtart board etiquette and message to new forum users .

The print server needs to have print drivers for all operating systems installed that will make use of the print server. ADDPRINTERCONNECTION will then connect to the printer on the specified print server and download the appropriate printer driver. If no appropriate printer driver is available, an appropriate errro code will be returned.

Code:

(I like to do it all without UDF's)


Why? UDFs are jsut custom extensions to the build-in KiXtart functions and enrich the functionality of KiXtart by providing more complex functionality. Please read the FAQ Forum for more info on UDFs.


mvandek2
(Fresh Scripter)
2004-02-07 03:37 PM
Re: no right to set wallpaper


No UDF's because its all extra handling, I just want an all-in standard login script I can use many times. Than I only need the file plus kix32.exe.

Code fragment:

$foto="test.bmp"
If NOT Exist ("C:\test\test.bmp")
Copy @lserver+"\users\software\"+$foto "C:\test\"+$foto
EndIf
SetWallpaper ("C:\test\"+$foto)

ADDPRINTERCONNECTION("\\SERVER-17\HP")
SetDefaultPrinter ("\\SERVER-17\HP5500")

(First needs printer share, second printer name, also nice.)


Sealeopard
(KiX Master)
2004-02-07 04:06 PM
Re: no right to set wallpaper

UDFs can be put into the main script as is expalined in the FAQ Forum.

You should also capture function results into return variables in order to suppress console output, also explained in the FAQ forum.

What is the error code of the failing script line? Put error checking in place to track it down, e.g.Code:

? 'Error '+@error+' - '+@serror


or use DEBUG ON.


mvandek2
(Fresh Scripter)
2004-02-07 05:47 PM
Re: no right to set wallpaper

First, thanks for your very quick answers, great !

I found out that the permissions of both the source and destination directory are not sufficient.
What is the best location for both so it won't be necessary to change permissions on all clients (by hand).


Sealeopard
(KiX Master)
2004-02-07 06:12 PM
Re: no right to set wallpaper

Wall papers should go into that standard wallpaper directory, e.g. %WINDIR%\Web\Wallpaper.

They should also be copied from the server to the clients via admin script, e.g. using COMNetView() to enumerate the clients, then looping through them and copying the files via admin shares into the appropriate directories.


mvandek2
(Fresh Scripter)
2004-02-08 05:23 PM
Re: no right to set wallpaper

But you still need to change permissions of the wallpaper folder on the clients right?

Setting permissions of the wallpaper folder on the server ok but I don't want to have to change anything on the clients.


Les
(KiX Master)
2004-02-08 05:29 PM
Re: no right to set wallpaper

Quoting Jens,
Quote:

They should also be copied from the server to the clients via admin script, e.g. using COMNetView() to enumerate the clients, then looping through them and copying the files via admin shares into the appropriate directories




The ADMIN SCRIPT runs not in the logon script but from a server or admin wksta under an administrator's creds, therefore no special perms need be assigned.


LonkeroAdministrator
(KiX Master Guru)
2004-02-08 05:35 PM
Re: no right to set wallpaper

if this place requires admin rights, it's not the default place.

Les
(KiX Master)
2004-02-08 05:59 PM
Re: no right to set wallpaper

Who can say what "Default" really is. The path Jens mentioned is just one of several locations Windows will look for it. It will also look in the %windir% folder as well as in the "My Documents"\"My Pictures" folder.

LonkeroAdministrator
(KiX Master Guru)
2004-02-08 06:10 PM
Re: no right to set wallpaper

that is what I ment.
but, users can without any policies set their wallpaper and if the given folder does not allow it, I have hard time believing it's "the" default.
maybe in wintosh 9x...


mvandek2
(Fresh Scripter)
2004-02-08 06:37 PM
Re: no right to set wallpaper

I don't really get all this.
There should be a place where you the server has permission to place a file, how about printer drivers (using addprinterconnection()), etc.


LonkeroAdministrator
(KiX Master Guru)
2004-02-08 06:44 PM
Re: no right to set wallpaper

what about it?
printing system is service of the OS.
if you want to have your own service, you must make it.
if you want a place where everyone can read, I suggest you use netlogon-dir
if you want place where everyone can write, try %userprofile%


Les
(KiX Master)
2004-02-08 07:41 PM
Re: no right to set wallpaper

Quote:

There should be a place where you the server has permission to place a file...



The server has nothing to do with it... it is all done by the client!

Just because the KiX script is hosted on the server's NetLogon share does not mean the server has anything to do with it. The script runs on the client in the user's security context.


It is the same for printer drivers. If users don't have rights to install the driver, it will fail. This is not a KiX limitation but rather your limitation. KiX does not elevate security context. To do that you need to deploy one of several methods explained in the FAQ forum.