REGISTRY commands

REGISTRY commands

Postby Silvio » Tue Nov 23, 2010 12:55 pm

I must insert a value into registry

oReg := TReg32():New(HKEY_CURRENT_USER, Key)
oReg:Set(Name,valore)

but here it not run because not found the variable into registry


what is the command to say " IF NOT FOUND THE name of variable create it " ?

I try with

IF ! FOUND (name)
oReg:Create( nKey, cRegKey )

but not run ok



then if insert oReg:ENd() it make error ...
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: REGISTRY commands

Postby Silvio » Wed Nov 24, 2010 8:08 am

// to hide the monitor property

Function main()

Key:="Software\Microsoft\Windows\CurrentVersion\Policies\System"
Name:="NoDispSettingsPage"
valore:=1


IF RegOpenKey( HKEY_CURRENT_USER,Key, @nHandle ) == 0
oReg := TReg32():New(HKEY_CURRENT_USER, Key)
oReg:Set(Name,valore)
ELSE
oReg := TReg32():New(HKEY_CURRENT_USER, Key)
oReg:Create( Name, valore )
endif


return nil




THe PROBLEM is IT not found System of Key
how I can to create this ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: REGISTRY commands

Postby TimStone » Mon Nov 29, 2010 7:54 pm

What version of Windows ? Starting with Vista ( and now Win 7 ), Registry entries go to Roaming. Thus, they are not where I want them placed. I finally gave up on the Registry and use a file on the server for my data.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: REGISTRY commands

Postby Silvio » Tue Nov 30, 2010 8:51 am

tim please see here viewtopic.php?f=3&t=20401&p=108171
on xp professional run ok
and try it and see on wich window it can run ok
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: REGISTRY commands

Postby TimStone » Tue Nov 30, 2010 4:56 pm

I only have Win 7 on my computers now. However, I abandoned using the Registry with Vista, and now use a configuration file. It actually works out much better. For local machines, I use a text file, and on the server I use a dbf with a single record.

No matter what I tried, I was not getting Registry entries to go where I wanted them. Instead they went where Microsoft wanted to place them, and when I tried to read in the original location, of course they are not there. Do a Find in the Registry editor and see where they were placed.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2904
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: REGISTRY commands

Postby Silvio » Wed Dec 01, 2010 10:42 am

Timm,

Sorry for my english ..

At school I need a procedure to block each computer because my boys must use only WINWORD and EXCEL instead they use the other application of window changing the configuration ( screensavers,desktop,...)

I making a procedure to block these features ...at school we have only win2000 and Win Xp

I found a file help (Windows Registry Guide 2003) and on some feature there is wrote "All Windows" and I 'd like to see ( when I finished my procedure) if it run on wich system ....
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: REGISTRY commands

Postby James Bott » Wed Dec 01, 2010 1:37 pm

Are you familiar with Windows Group Policies and Software Restriction Policies?

http://www.dedoimedo.com/computers/policies.html

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: REGISTRY commands

Postby Silvio » Wed Dec 01, 2010 6:14 pm

James,
yes I Know this but we not have all windows NT...
but I want create it from fwh source code and not set manual each computer ...

I have at my school 16 Laboratories and each Laboratory have 30 computers...
and on each room we have until 3 computers for an total ammout of 460 computers...then we must calc also 34 netbooks, 12 latop, 10 old latop...

How Many time I must lose to set all pcs ?
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: REGISTRY commands

Postby StefanHaupt » Thu Dec 02, 2010 9:19 am

Silvio,

you can create a .reg file and insert your settings from your program with
Code: Select all  Expand view
winexec ("regedit /s Settings.reg", SW_HIDE )
kind regards
Stefan
StefanHaupt
 
Posts: 824
Joined: Thu Oct 13, 2005 7:39 am
Location: Germany

Re: REGISTRY commands

Postby Silvio » Thu Dec 02, 2010 11:10 am

STEPHAN
I created somethnig of it
SCHOOL ADMIN SOFTWARE

SOME SNAPSHOTS


Image


Image


HIDE /SHOW DEVICES

Image
Best Regards, Saludos

Falconi Silvio
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests