Page 1 of 2 12>
Topic Options
#110320 - 2003-12-15 01:30 PM no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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?

Top
#110321 - 2003-12-15 01:37 PM Re: no right to set wallpaper
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
what happens when you try with this line instead :

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



Top
#110322 - 2003-12-15 01:44 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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.

Top
#110323 - 2003-12-15 02:40 PM Re: no right to set wallpaper
Wizard Offline
Hey THIS is FUN
*****

Registered: 2000-12-05
Posts: 264
Loc: Bristol, England
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
_________________________
Wizard
There's no place like 127.0.0.1

vb | kix | batch | html | cfm | js | english

Top
#110324 - 2003-12-15 03:27 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
Yeah, that is probably best.

Thanks

Top
#110325 - 2003-12-15 03:52 PM Re: no right to set wallpaper
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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

_________________________
There are two types of vessels, submarines and targets.

Top
#110326 - 2003-12-15 04:06 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
Thanks!

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


Top
#110327 - 2003-12-15 04:09 PM Re: no right to set wallpaper
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
See the FAQ Forum under How to write a UDF and How to use UDFs
_________________________
There are two types of vessels, submarines and targets.

Top
#110328 - 2004-02-07 12:18 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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


Edited by mvandek2 (2004-02-07 01:19 PM)

Top
#110329 - 2004-02-07 03:22 PM Re: no right to set wallpaper
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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.
_________________________
There are two types of vessels, submarines and targets.

Top
#110330 - 2004-02-07 03:37 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21

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.)

Top
#110331 - 2004-02-07 04:06 PM Re: no right to set wallpaper
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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.
_________________________
There are two types of vessels, submarines and targets.

Top
#110332 - 2004-02-07 05:47 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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).


Edited by mvandek2 (2004-02-07 06:04 PM)

Top
#110333 - 2004-02-07 06:12 PM Re: no right to set wallpaper
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
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.
_________________________
There are two types of vessels, submarines and targets.

Top
#110334 - 2004-02-08 05:23 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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.

Top
#110335 - 2004-02-08 05:29 PM Re: no right to set wallpaper
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110336 - 2004-02-08 05:35 PM Re: no right to set wallpaper
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
if this place requires admin rights, it's not the default place.
_________________________
!

download KiXnet

Top
#110337 - 2004-02-08 05:59 PM Re: no right to set wallpaper
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
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.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#110338 - 2004-02-08 06:10 PM Re: no right to set wallpaper
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
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...
_________________________
!

download KiXnet

Top
#110339 - 2004-02-08 06:37 PM Re: no right to set wallpaper
mvandek2 Offline
Fresh Scripter

Registered: 2003-12-10
Posts: 21
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.

Top
Page 1 of 2 12>


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

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.075 seconds in which 0.024 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