Login

Esqueci minha senha

Buscar
 
 

Resultados por:
 


Rechercher Busca avançada

Quem está conectado
15 usuários online :: Nenhum usuário registrado, Nenhum Invisível e 15 Visitantes :: 2 Motores de busca

Nenhum

[ Ver toda a lista ]


O recorde de usuários online foi de 337 em 27/12/2010, 08:00
Brasília
Estamos no Twitter
Nossa Comunidade
Nosso Grupo
Últimos assuntos
» Registrar OCX Windows Seven
Ontem à(s) 16:44 por megasoft

» Criar Variáveis em sequencia
Ontem à(s) 16:37 por megasoft

» No final a Impressora não Ejecta cem corta o papel
Ontem à(s) 16:30 por megasoft

» Ajuda com Imagens no MySQL
Ontem à(s) 16:20 por megasoft

» Instalando MySQL no linux
Ontem à(s) 13:56 por hugo

» Como Criar arquivos de Log`s para certos usuarios
Ontem à(s) 13:55 por hugo

» MySQL X VFP @MEMO
Ontem à(s) 13:53 por hugo

» Dirf
6/2/2012, 06:54 por alceu11

» EXE Instalador Não Executa
5/2/2012, 16:57 por Sub-Zero

» SQL Server Setup
5/2/2012, 13:06 por Sub-Zero

» localizar registro no postgreslq (alterar/incluir)
4/2/2012, 19:21 por mauro victoria

» Saber se existe uma tabela??
4/2/2012, 10:12 por Sub-Zero

» Empacotar arquivos em um único executável
3/2/2012, 14:48 por halisson

» VAGAS ANALISTA DE SISTEMAS - VISUAL FOX
3/2/2012, 08:53 por Nelson Arcas

» Escrever a DATA por extenso
1/2/2012, 23:55 por alceu11

» ActionScript - Introdução
31/1/2012, 19:25 por Fonsecca

» Selecionar campo com mais de 9 caracteres
31/1/2012, 15:45 por marcio

» CEP do BRASIL e dos UFs do brasil com codigo do IBGE para nf - <<<
31/1/2012, 09:20 por alceu11

» Tutorial HTML
30/1/2012, 15:19 por Fonsecca

» PHP + CSS
30/1/2012, 15:09 por Fonsecca

Registrar OCX Windows Seven

29/7/2011, 11:48 por Julio

Bom Dia Pessoal do Forum

Alguem ja teve que registrar alguma OCX no windows seven?
Tentei …

Comentários: 15

Criar Variáveis em sequencia

18/1/2012, 08:19 por BrunoMesquita

Olá pessoal como faço para gerar variáveis em sequencia, tipo: Se tenho 6 registros cria-se 6 …

Comentários: 6

No final a Impressora não Ejecta cem corta o papel

19/1/2012, 06:46 por clima238

bom dia
o seguinte código imprime correctamente, só no fim não ejecta nem corta o papel,
alguem …

Comentários: 1

Ajuda com Imagens no MySQL

25/1/2012, 08:53 por megasoft

Olá vou resumir aqui como estou fazendo.
Código:
xFoto_Prod = …


Comentários: 5

Dirf

4/2/2012, 19:25 por mauro victoria

Boa noite estou com dificuldade de entender o layout da dirf , alguem tem um arquivo txt para que …

Comentários: 1

Estatísticas
Temos 3637 usuários registrados
O último usuário registrado atende pelo nome de reginaldolimas

Os nossos membros postaram um total de 13978 mensagens em 1958 assuntos

WSH para ler, gravar e excluir chaves do registro

Ver o tópico anterior Ver o tópico seguinte Ir em baixo

Anexo WSH para ler, gravar e excluir chaves do registro

Mensagem por Marcos Guedes em 12/3/2010, 13:45

Código:
WSHShell = CreateObject("WScript.Shell")


*!* Create Registry Keys
Código:
WSHShell.Popup( "Create key HKCU\MyRegKey with value 'Top level key'")
WSHShell.RegWrite( "HKCU\MyRegKey\", "Top level key")
 
WSHShell.Popup( "Create key HKCU\MyRegKey\Entry with value 'Second level key'")
WSHShell.RegWrite( "HKCU\MyRegKey\Entry\", "Second level key")
 
WSHShell.Popup( "Set value HKCU\MyRegKey\Value to REG_SZ 1")
WSHShell.RegWrite ("HKCU\MyRegKey\Value", 1)
 
WSHShell.Popup( "Set value HKCU\MyRegKey\Entry to REG_DWORD 2")
WSHShell.RegWrite( "HKCU\MyRegKey\Entry", 2, "REG_DWORD")
 
WSHShell.Popup( "Set value HKCU\MyRegKey\Entry\Value1 to REG_BINARY 3")
WSHShell.RegWrite( "HKCU\MyRegKey\Entry\Value1", 3, "REG_BINARY")


*!* Read Registry Keys
Código:
lcValue1 = WSHShell.RegRead("HKCU\MyRegKey\")
WSHShell.Popup("Value of HKCU\MyRegKey: " + lcValue1)
 
lcValue2 = WSHShell.RegRead("HKCU\MyRegKey\Entry\")
WSHShell.Popup("Value of HKCU\MyRegKey\Entry\: " + lcValue2)
 
lcValue3 = WSHShell.RegRead("HKCU\MyRegKey\Value")
WSHShell.Popup("Value of HKCU\MyRegKey\Value: " + lcValue3)
 
lnValue1 = WSHShell.RegRead("HKCU\MyRegKey\Entry")
WSHShell.Popup("Value of HKCU\MyRegKey\Entry: " + ALLTRIM(STR(lnValue1)))
 
lnValue3 = WSHShell.RegRead("HKCU\MyRegKey\Entry\Value1")
WSHShell.Popup("Value of HKCU\MyRegKey\Entry\Value1: " + ALLTRIM(STR(lnValue3(1))))


*!* Delete Registry Keys
Código:
WSHShell.Popup( "Delete value HKCU\MyRegKey\Entry\Value1")
WSHShell.RegDelete( "HKCU\MyRegKey\Entry\Value1")
 
WSHShell.Popup ("Delete key HKCU\MyRegKey\Entry")
WSHShell.RegDelete( "HKCU\MyRegKey\Entry\")
 
WSHShell.Popup ("Delete key HKCU\MyRegKey")
WSHShell.RegDelete( "HKCU\MyRegKey\")


Fonte:
[Você precisa estar registrado e conectado para ver este link.]

_________________
Marcos Guedes - Programador e desenvolvedor Web.

Convidado, seja nosso seguidor no Twitter:
twitter.com/programacaobras

Marcos Guedes
Webmaster
Webmaster


Voltar ao Topo Ir em baixo

Anexo Re: WSH para ler, gravar e excluir chaves do registro

Mensagem por hugo em 12/3/2010, 14:36

muito bom

_________________
"A tristeza é a falta de alegria, mais sem ela eu não poderia entender a alegria do fato de que a felicidade existe!"
Helio Leites - [Você precisa estar registrado e conectado para ver este link.]

hugo
Usuário 5 Estrelas
Usuário 5 Estrelas


Voltar ao Topo Ir em baixo

Anexo Re: WSH para ler, gravar e excluir chaves do registro

Mensagem por djguina em 6/5/2010, 09:39

Uma dúvida...

E se eu não tiver a Chave de Registro? pra mim apresenta um erro... como perguntar pro meu sistema se existe essa chave?


Código:

OLE IDispatch exception code 0 from WshShell.RegRead: Raiz Inválida na chave de Registro "Minha chave"...

djguina
Começando a Participar
Começando a Participar


Voltar ao Topo Ir em baixo

Anexo Re: WSH para ler, gravar e excluir chaves do registro

Mensagem por Marcos Guedes em 6/5/2010, 12:04

Veja se este código ajuda:
Código:
LOCAL lcversion
lcversion = "7.0"

PUBLIC goapp
goapp = CREATEOBJECT('capp')
MESSAGEBOX(goapp.readreg('HLM','Software\Microsoft\VisualFoxpro\' + lcversion +;
   '\Registration','ProductID'))
goapp = null

DEFINE CLASS capp AS CONTAINER

   *-- Reads the windows Registry.
   PROCEDURE readreg
      * Start of Code
      LPARAMETERS tckey,tcsubkey,tcvalue
      IF PCOUNT() = 2
         tcvalue = ""
      ENDIF

      * setup environment

      LOCAL nkey, csubkey, cvalue,  cvalueread

      #DEFINE hkey_users                  -2147483645
      #DEFINE hkey_local_machine          -2147483646
      #DEFINE hkey_current_user          -2147483647
      #DEFINE hkey_classes_root            -2147483648

      DO CASE
         CASE m.tckey == "HCR"
            nkey = hkey_classes_root
         CASE m.tckey == "HLM"
            nkey = hkey_local_machine
         CASE m.tckey = "HCU"
            nkey = hkey_current_user
         CASE m.tckey = "HCR"
            nkey = hkey_classes_root
         OTHERWISE
            nkey = m.tckey
      ENDCASE

      csubkey = m.tcsubkey
      cvalue  = m.tcvalue

      * example 1
      * nKey = HKEY_LOCAL_MACHINE
      * cSubKey = "Software\VfpRegTest"
      * cValue = "TestREG_SZ"

      * example 2
      * nKey = HKEY_CLASSES_ROOT
      * cSubKey = "Spin.SpinButton\CLSID"
      * cValue = ""


      * here is where we will actually read the registry
      cvalueread = THIS.readreg_sz(nkey, csubkey, cvalue)

      IF (EMPTY(cvalueread)) THEN
         cvalueread = "REGISTRY KEY NOT FOUND"
         * MESSAGEBOX("Function Not Successful.")  && testing only
      ELSE
         * MESSAGEBOX("Function Successful.    " + cValueRead)  && testing only
      ENDIF

      RETURN cvalueread
   ENDPROC


   *-- API's used by the ReadReg method.
   PROCEDURE readreg_sz
      * This function reads a REG_SZ value from the registry. If successful,
      * it will return the value read. If not successful, it will return an empty string.

      PARAMETERS  nkey, csubkey, cvalue
      * nKey The root key to open. It can be any of the constants defined below.
      *  #DEFINE HKEY_CLASSES_ROOT          -2147483648
      *  #DEFINE HKEY_CURRENT_USER          -2147483647
      *  #DEFINE HKEY_LOCAL_MACHINE          -2147483646
      *  #DEFINE HKEY_USERS                  -2147483645
      * cSubKey The SubKey to open.
      * cValue The value that is going to be read.

      * Constants that are needed for Registry functions
      #DEFINE reg_sz  1

      * WIN 32 API functions that are used
      DECLARE INTEGER RegOpenKey IN Win32API ;
         INTEGER nHKey, STRING @cSubKey, INTEGER @nResult
      DECLARE INTEGER RegQueryValueEx IN Win32API ;
         INTEGER nHKey, STRING lpszValueName, INTEGER dwReserved,;
         INTEGER @lpdwType, STRING @lpbData, INTEGER @lpcbData
      DECLARE INTEGER RegCloseKey IN Win32API INTEGER nHKey

      * Local variables used
      LOCAL nerrcode      && Error Code returned from Registry functions
      LOCAL nkeyhandle    && Handle to Key that is opened in the Registry
      LOCAL lpdwvaluetype && Type of Value that we are looking for
      LOCAL lpbvalue      && The data stored in the value
      LOCAL lpcbvaluesize && Size of the variable
      LOCAL lpdwreserved  && Reserved Must be 0

      * Initialize the variables
      nkeyhandle = 0
      lpdwreserved = 0
      lpdwvaluetype = reg_sz
      lpbvalue = ""

      nerrcode = regopenkey(nkey, csubkey, @nkeyhandle)
      * If the error code isn't 0, then the key doesn't exist or can't be opened.
      IF (nerrcode # 0) THEN
         RETURN ""
      ENDIF

      lpcbvaluesize = 1
      * Get the size of the data in the value
      nerrcode=regqueryvalueex(nkeyhandle, cvalue, lpdwreserved, @lpdwvaluetype, @lpbvalue, @lpcbvaluesize)

      * Make the buffer big enough
      lpbvalue = SPACE(lpcbvaluesize)
      nerrcode=regqueryvalueex(nkeyhandle, cvalue, lpdwreserved, @lpdwvaluetype, @lpbvalue, @lpcbvaluesize)

      =regclosekey(nkeyhandle)
      IF (nerrcode # 0) THEN
         RETURN ""
      ENDIF

      lpbvalue = LEFT(lpbvalue, lpcbvaluesize - 1)
      RETURN lpbvalue
   ENDPROC


ENDDEFINE

Fonte:
- [Você precisa estar registrado e conectado para ver este link.]

_________________
Marcos Guedes - Programador e desenvolvedor Web.

Convidado, seja nosso seguidor no Twitter:
twitter.com/programacaobras

Marcos Guedes
Webmaster
Webmaster


Voltar ao Topo Ir em baixo

Ver o tópico anterior Ver o tópico seguinte Voltar ao Topo


Permissão deste fórum:
Você não pode responder aos tópicos neste fórum