- Ljn
- Idade : 51
Botão em HTA
Seg Set 09, 2013 11:12 pm
Boa noite,
Tenho um código em HTML que ao ser executado abre o editor de textos MSWord.
Ao invés de abrir direto, seria possível criar um botão para executar o MSword somente quando acionado?
Desde já agradeço a ajuda de todos.
Fiquem com Deus.
Tenho um código em HTML que ao ser executado abre o editor de textos MSWord.
Ao invés de abrir direto, seria possível criar um botão para executar o MSword somente quando acionado?
Desde já agradeço a ajuda de todos.
Fiquem com Deus.
- Boss-Head
- Idade : 36
Re: Botão em HTA
Ter Set 10, 2013 6:19 am
[Você precisa estar registrado e conectado para ver este link.]
Exemplo de usos...
Senha 123
Exemplo de usos...
Senha 123
<HTML><HEAD>
<TITLE></TITLE>
<HTA:APPLICATION
APPLICATIONNAME="Exemplo de menu em HTA"
BORDER="THIN"
BORDERSTYLE="NORMAL"
ICON="Explorer.exe"
INNERBORDER="NO"
MAXIMIZEBUTTON="NO"
MINIMIZEBUTTON="NO"
SCROLL="NO"
SELECTION="NO"
SINGLEINSTANCE="YES"/></HEAD>
<META HTTP-EQUIV="MSThemeCompatible" CONTENT="YES">
<BODY TOPMARGIN="1" LEFTMARGIN="1"><CENTER><DIV><SPAN ID="ONSCR"></SPAN></DIV></CENTER></BODY>
<SCRIPT LANGUAGE="VBScript">
Dim objFSO : Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim WS : Set WS = CreateObject("wscript.shell")
Temp = WS.ExpandEnvironmentStrings("%Temp%")
Guarda = Temp &"\Guarda.txt"
Sub window_onload()
CenterWindow 230,130
Call TextFocus
Dim Compteur : Compteur = 0
If Not objFSO.FileExists(Guarda) Then
Dim Logfile : Set Logfile = objFSO.OpenTextFile(Guarda,2,True)
Logfile.writeline Compteur
Logfile.Close
end if
End Sub
Sub CenterWindow(x,y)
window.resizeTo x, y
iLeft = window.screen.availWidth/2 - x/2
itop = window.screen.availHeight/2 - y/2
window.moveTo ileft, itop
End Sub
Sub PasswordForm()
Fechar("Explorer.exe")
Self.document.title = "Senha"
Self.document.bgColor = "#BBBFFF"
ONSCR.InnerHTML="<center><FONT COLOR=""#FFFFFF"" SIZE=""+1"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Digite a Senha</FONT<br><input type=""password"" name=""PasswordArea"" size=""20"" onKeyUp=""TextFocus""><P>"_
&"<input type=""Submit"" STYLE=""HEIGHT:25;WIDTH:110"" value=""Acessar Menu"" onClick=""VerifPass"">"
END Sub
Sub VerifPass
Dim NB_Guarda_MAX : NB_Guarda_MAX = 3
Password = "123"
Set Readfile = objFSO.OpenTextFile(Guarda,1)
Compteur = Readfile.ReadAll
Readfile.Close
Controle = True
While Controle
Compteur = Compteur + 1
NB_Guarda_Restant = NB_Guarda_MAX - Compteur
Set Logfile = objFSO.OpenTextFile(Guarda,2,True)
Logfile.writeline Compteur
Logfile.Close
If PasswordArea.Value <> Password Then
MsgBox "Erro de Senha - numero de tentativas - " & Compteur &vbCr&_
"Restante - "& NB_Guarda_Restant,16,"Erro de Senha"
Location.Reload(True)
end if
If PasswordArea.Value = Password Then
MsgBox "Senha Correta !",64,"Senha Correta !"
If objFSO.FileExists(Guarda) Then objFSO.DeleteFile Guarda,True
Controle = False
Call MenuPrincipal()
Call Abrir("Explorer.exe")
Exit Sub
End If
If Compteur = NB_Guarda_MAX Then
If objFSO.FileExists(Guarda) Then objFSO.DeleteFile Guarda,True
MsgBox "Limite de tentativas esgotou ! "&vbcr& "O computador será reiniciado em 90 segundos ",48,"Limite de tentativas atingido"
Command="cmd /c Shutdown.exe -r -t 90 -c " & chr(34) & "Salve seus trabalhos, porque o computador será reiniciado em 90 segundos" & chr(34)
'Executar = WS.Run(Command,0,False)
window.close
End If
Exit Sub
wend
End Sub
Sub TextFocus
PasswordArea.Focus
End Sub
SUB MenuPrincipal()
Self.document.title = "Exemplo de Menu en HTA"
CALL InnerWindowSize(222,587)
ONSCR.InnerHTML="<TABLE HEIGHT=""50"" WIDTH=""220"" BORDER=""1"" BGCOLOR=""#BBBFFF"" BORDERCOLOR=""#000000"" CELLPADDING=""0"" CELLSPACING=""1"">"_
&"<TR BGCOLOR=""#346E99""><TD COLSPAN=""2""><CENTER><FONT COLOR=""#FFFFFF"" SIZE=""+2"" FACE=""VERDANA,ARIAL,HELVETICA,SANS-SERIF"">Menu Principal</FONT></CENTER></TD></TR></TABLE>"_
&"<TABLE WIDTH=""220"" HEIGHT=""184"" BORDER=""1"" BGCOLOR=""#BBBFFF"" BORDERCOLOR=""#000000"" CELLPADDING=""0"" CELLSPACING=""1"">"_
&"<P><TR><TD><CENTER><INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Calculadora"" ONCLICK=""Run(1)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Internet Explorer"" LANGUAGE=""VBScript"" ONCLICK=Run(2)><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Linha de Comando"" LANGUAGE=""VBScript"" ONCLICK=Run(3)><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Meu Computador"" ONCLICK=""Run(4)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Lixeira"" ONCLICK=""Run(5)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Meus Documentos"" ONCLICK=""Run(6)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Arquivos de Programas"" ONCLICK=""Run(7)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Adicionar / Remover Prog."" ONCLICK=""Run(""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Painel de Controle"" ONCLICK=""Run(9)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Propriedades de Video"" ONCLICK=""Run(10)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""Bloco de Notas"" ONCLICK=""Run(11)""><P>"_
&"<INPUT TYPE=""BUTTON"" STYLE=""HEIGHT:25;WIDTH:165"" VALUE=""WinWord"" ONCLICK=""Run(12)""><P>"_
&"</TD></CENTER></TR></TABLE>"
END SUB
SUB InnerWindowSize(intWidth,intHeight)
Self.ResizeTo intWidth,intHeight
Self.ResizeTo intWidth+(intWidth-Document.Body.OffsetWidth),intHeight+(intHeight-Document.Body.OffsetHeight)
Self.MoveTo (Screen.Width/2)-(intWidth/2),(Screen.Height/2)-(intHeight/2)
END SUB
Sub Run(var)
Set WS = CreateObject("WScript.shell")
Select Case var
Case 1 WS.run("calc.exe")
Case 2 WS.run("iexplore.exe")
Case 3 WS.run("cmd.exe")
Case 4 WS.run("Explorer.exe ::{20d04fe0-3aea-1069-a2d8-08002b30309d}")'Estação de trabalho
Case 5 WS.run "Explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E}"'Lixeira
Case 6
MyDoc = WS.SpecialFolders("MyDocuments") & "\"
WS.run "Explorer.exe /n,/e,/root,"& MyDoc
Case 7
WS.run "Explorer.exe /n,/e,/root,C:\Program Files"
Case 8
WS.run "CONTROL.EXE APPWIZ.CPL"
Case 9
WS.run "CONTROL.EXE"
Case 10
WS.run "CONTROL.EXE DESK.CPL"
Case 11
WS.run "NOTEPAD.EXE"
Case 12
WS.run "Winword"
End select
End Sub
Sub Fechar(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Taskkill /F /IM "&Process&""
Execution = Ws.Run(Command,0,True)
End Sub
Sub Abrir(Process)
Set Ws = CreateObject("Wscript.Shell")
Command = "cmd /c Start "&Process&""
Execution = Ws.Run(Command,0,True)
End Sub
Call PasswordForm()
</SCRIPT>
- Boss-Head
- Idade : 36
Re: Botão em HTA
Ter Set 10, 2013 8:30 pm
Accessibility Controls - access.cpl
Add Hardware Wizard - hdwwiz.cpl
Add/Remove Programs - appwiz.cpl
Administrative Tools - control.exe admintools
Automatic Updates - wuaucpl.cpl
Bluetooth Transfer Wizard - fsquirt
Calculator - calc
Certificate Manager - certmgr.msc
Character Map - charmap
Check Disk Utility - chkdsk
Clipboard Viewer - clipbrd
Command Prompt - cmd
Component Services - dcomcnfg
Computer Management - compmgmt.msc
Date and Time Properties - timedate.cpl
DDE Shares - ddeshare
Device Manager - devmgmt.msc
Direct X Control Panel (if installed) - directx.cpl
Direct X Troubleshooter - dxdiag
Disk Cleanup Utility - cleanmgr
Disk Defragment - dfrg.msc
Disk Management - diskmgmt.msc
Disk Partition Manager - diskpart
Display Properties - control.exe
Desktop display Properties - desk.cpl
Display Properties (w/Appearance Tab Preselected) - control.exe color
Dr. Watson System Troubleshooting Utility - drwtsn32
Driver Verifier Utility - verifier
Event Viewer - eventvwr.msc
File Signature Verification Tool - sigverif
Findfast - findfast.cpl
Folders Properties - control.exe folders
Fonts - control.exe fonts
Fonts Folder - fonts
Free Cell Card Game - freecell
Game Controllers - joy.cpl
Group Policy Editor (XP Prof) - gpedit.msc
Hearts Card Game - mshearts
Iexpress Wizard - iexpress
Indexing Service - ciadv.msc
Internet Properties - inetcpl.cpl
Java Control Panel (if installed) - jpicpl32.cpl
Java Control Panel (if installed) - javaws
Keyboard Properties - control.exe keyboard
Local Security Settings - secpol.msc
Local Users and Groups - lusrmgr.msc
Logs You Out Of Windows - logoff
Microsoft Chat - winchat
Minesweeper Game - winmine
Mouse Properties - control.exe mouse
Mouse Properties - main.cpl
Network Connections - control.exe netconnections
Network Connections - ncpa.cpl
Network Setup Wizard - netsetup.cpl
Nview Desktop Manager (if installed) - nvtuicpl.cpl
Object Packager - packager
ODBC Data Source Administrator - odbccp32.cpl
On Screen Keyboard - osk
Opens AC3 Filter (if installed) - ac3filter.cpl
Password Properties - password.cpl
Performance Monitor - perfmon.msc
Performance Monitor - perfmon
Phone and Modem Options - telephon.cpl
Power Configuration - powercfg.cpl
Printers and Faxes - control.exe printers
Printers Folder - printers
Private Character Editor - eudcedit
Quicktime (If Installed) - QuickTime.cpl
Regional Settings - intl.cpl
Registry Editor - regedit
Registry Editor - regedit32
Removable Storage - ntmsmgr.msc
Removable Storage Operator Requests - ntmsoprq.msc
Resultant Set of Policy - rsop.msc
Resultant Set of Policy (XP Prof) - rsop.msc
Scanners and Cameras - sticpl.cpl
Scheduled Tasks - control.exe schedtasks
Security Center - wscui.cpl
Services - services.msc
Shared Folders - fsmgmt.msc
Shuts Down Windows - shutdown
Sounds and Audio - mmsys.cpl
Spider Solitare Card Game - spider
SQL Client Configuration - cliconfg
System Configuration Editor - sysedit
System Configuration Utility - msconfig
System File Checker Utility - sfc
System Properties - sysdm.cpl
Task Manager - taskmgr
Telnet Client - telnet
User Account Management - nusrmgr.cpl
Utility Manager - utilman
Windows Firewall - firewall.cpl
Windows Magnifier - magnify
Windows Management Infrastructure - wmimgmt.msc
Windows System Security Tool - syskey
Windows Update Launches - wupdmgr
Windows XP Tour Wizard - tourstart
Wordpad - write
Add Hardware Wizard - hdwwiz.cpl
Add/Remove Programs - appwiz.cpl
Administrative Tools - control.exe admintools
Automatic Updates - wuaucpl.cpl
Bluetooth Transfer Wizard - fsquirt
Calculator - calc
Certificate Manager - certmgr.msc
Character Map - charmap
Check Disk Utility - chkdsk
Clipboard Viewer - clipbrd
Command Prompt - cmd
Component Services - dcomcnfg
Computer Management - compmgmt.msc
Date and Time Properties - timedate.cpl
DDE Shares - ddeshare
Device Manager - devmgmt.msc
Direct X Control Panel (if installed) - directx.cpl
Direct X Troubleshooter - dxdiag
Disk Cleanup Utility - cleanmgr
Disk Defragment - dfrg.msc
Disk Management - diskmgmt.msc
Disk Partition Manager - diskpart
Display Properties - control.exe
Desktop display Properties - desk.cpl
Display Properties (w/Appearance Tab Preselected) - control.exe color
Dr. Watson System Troubleshooting Utility - drwtsn32
Driver Verifier Utility - verifier
Event Viewer - eventvwr.msc
File Signature Verification Tool - sigverif
Findfast - findfast.cpl
Folders Properties - control.exe folders
Fonts - control.exe fonts
Fonts Folder - fonts
Free Cell Card Game - freecell
Game Controllers - joy.cpl
Group Policy Editor (XP Prof) - gpedit.msc
Hearts Card Game - mshearts
Iexpress Wizard - iexpress
Indexing Service - ciadv.msc
Internet Properties - inetcpl.cpl
Java Control Panel (if installed) - jpicpl32.cpl
Java Control Panel (if installed) - javaws
Keyboard Properties - control.exe keyboard
Local Security Settings - secpol.msc
Local Users and Groups - lusrmgr.msc
Logs You Out Of Windows - logoff
Microsoft Chat - winchat
Minesweeper Game - winmine
Mouse Properties - control.exe mouse
Mouse Properties - main.cpl
Network Connections - control.exe netconnections
Network Connections - ncpa.cpl
Network Setup Wizard - netsetup.cpl
Nview Desktop Manager (if installed) - nvtuicpl.cpl
Object Packager - packager
ODBC Data Source Administrator - odbccp32.cpl
On Screen Keyboard - osk
Opens AC3 Filter (if installed) - ac3filter.cpl
Password Properties - password.cpl
Performance Monitor - perfmon.msc
Performance Monitor - perfmon
Phone and Modem Options - telephon.cpl
Power Configuration - powercfg.cpl
Printers and Faxes - control.exe printers
Printers Folder - printers
Private Character Editor - eudcedit
Quicktime (If Installed) - QuickTime.cpl
Regional Settings - intl.cpl
Registry Editor - regedit
Registry Editor - regedit32
Removable Storage - ntmsmgr.msc
Removable Storage Operator Requests - ntmsoprq.msc
Resultant Set of Policy - rsop.msc
Resultant Set of Policy (XP Prof) - rsop.msc
Scanners and Cameras - sticpl.cpl
Scheduled Tasks - control.exe schedtasks
Security Center - wscui.cpl
Services - services.msc
Shared Folders - fsmgmt.msc
Shuts Down Windows - shutdown
Sounds and Audio - mmsys.cpl
Spider Solitare Card Game - spider
SQL Client Configuration - cliconfg
System Configuration Editor - sysedit
System Configuration Utility - msconfig
System File Checker Utility - sfc
System Properties - sysdm.cpl
Task Manager - taskmgr
Telnet Client - telnet
User Account Management - nusrmgr.cpl
Utility Manager - utilman
Windows Firewall - firewall.cpl
Windows Magnifier - magnify
Windows Management Infrastructure - wmimgmt.msc
Windows System Security Tool - syskey
Windows Update Launches - wupdmgr
Windows XP Tour Wizard - tourstart
Wordpad - write
- Boss-Head
- Idade : 36
Re: Botão em HTA
Ter Set 10, 2013 8:33 pm
Windows 7
informações sobre seu Windows.
Comando:
%systemroot%\system32\winver.exe
Alterar Configurações de UAC
Agora vai ficar mais fácil acessar as configurações de controle de conta de usuários do seu Windows 7 e remover aquelas mensagens chatas da tela.
Comando:
%systemroot%\system32\UserAccountControlSettings.e xe
Centro de Ação
Central de ações para configuração de Backup, Windows Update.
Comando:
%systemroot%\system32\wscui.cpl
Solução de problema
"Soluciona problemas no computador".
Comando:
%systemroot%\system32\control.exe /name Microsoft.Troubleshooting
Gerenciamento do computador
Gerenciar praticamente tudo no Windows 7.
Comando:
%systemroot%\system32\compmgmt.msc
Informações do sistema
As informações do seu computador, sistema, drivers e assim por diante.
Comando:
%systemroot%\system32\msinfo32.exe
Visualizador de Eventos
Exibe mensagens de monitoramento e de solução de problemas.
Comando:
%systemroot%\system32\eventvwr.exe
Programas
Iniciar, adicionar ou remover programas e componentes do Windows.
Comando:
%systemroot%\system32\appwiz.cpl
Propriedades do Sistema
Exibe informações básicas sobre as configurações do sistema e do computador.
Comando:
%systemroot%\system32\control.exe system
Opções da Internet
Exibe as propriedades da internet.
Comando:
%systemroot%\system32\inetcpl.cpl
Configuração do protocolo IP
Exibe informações sobre seu IP, DNS, Máscara e assim por diante.
Comando:
%systemroot%\system32\cmd.exe /k %windir%\system32\ipconfig.exe
Avançado:
%systemroot%\system32\cmd.exe /k %windir%\system32\ipconfig.exe /all
Desenpenho do sistema
Monitore o desempenho do seu computador.
Comando:
%systemroot%\system32\perfmon.exe
Avançado:
%systemroot%\system32\perfmon.exe /sys
Monitor de recursos
Monitore os recursos do seu computador.
Comando:
%systemroot%\system32\resmon.exe
Gerenciador de Tarefas
Exibe detalhes sobre processos, programas, rede, e tudo sobre o seu computar em tempo real.
Comando:
%systemroot%\system32\taskmgr.exe
Prompt de comando
Abre o prompt de comando.
Comando:
%systemroot%\system32\cmd.exe
Registro do Windows
Abre o Editor de Registro do Windows.
Comando:
%systemroot%\system32\regedt32.exe
Assistência Remota
Receba ou ofereça ajuda para seus amigos remotamente.
Comando:
%systemroot%\system32\msra.exe
Restaurar do sistema
Meio que uma máquina do tempo do seu Windows, ajuda a resolver problemas voltando no tempo.
Comando:
%systemroot%\system32\rstrui.exe
informações sobre seu Windows.
Comando:
%systemroot%\system32\winver.exe
Alterar Configurações de UAC
Agora vai ficar mais fácil acessar as configurações de controle de conta de usuários do seu Windows 7 e remover aquelas mensagens chatas da tela.
Comando:
%systemroot%\system32\UserAccountControlSettings.e xe
Centro de Ação
Central de ações para configuração de Backup, Windows Update.
Comando:
%systemroot%\system32\wscui.cpl
Solução de problema
"Soluciona problemas no computador".
Comando:
%systemroot%\system32\control.exe /name Microsoft.Troubleshooting
Gerenciamento do computador
Gerenciar praticamente tudo no Windows 7.
Comando:
%systemroot%\system32\compmgmt.msc
Informações do sistema
As informações do seu computador, sistema, drivers e assim por diante.
Comando:
%systemroot%\system32\msinfo32.exe
Visualizador de Eventos
Exibe mensagens de monitoramento e de solução de problemas.
Comando:
%systemroot%\system32\eventvwr.exe
Programas
Iniciar, adicionar ou remover programas e componentes do Windows.
Comando:
%systemroot%\system32\appwiz.cpl
Propriedades do Sistema
Exibe informações básicas sobre as configurações do sistema e do computador.
Comando:
%systemroot%\system32\control.exe system
Opções da Internet
Exibe as propriedades da internet.
Comando:
%systemroot%\system32\inetcpl.cpl
Configuração do protocolo IP
Exibe informações sobre seu IP, DNS, Máscara e assim por diante.
Comando:
%systemroot%\system32\cmd.exe /k %windir%\system32\ipconfig.exe
Avançado:
%systemroot%\system32\cmd.exe /k %windir%\system32\ipconfig.exe /all
Desenpenho do sistema
Monitore o desempenho do seu computador.
Comando:
%systemroot%\system32\perfmon.exe
Avançado:
%systemroot%\system32\perfmon.exe /sys
Monitor de recursos
Monitore os recursos do seu computador.
Comando:
%systemroot%\system32\resmon.exe
Gerenciador de Tarefas
Exibe detalhes sobre processos, programas, rede, e tudo sobre o seu computar em tempo real.
Comando:
%systemroot%\system32\taskmgr.exe
Prompt de comando
Abre o prompt de comando.
Comando:
%systemroot%\system32\cmd.exe
Registro do Windows
Abre o Editor de Registro do Windows.
Comando:
%systemroot%\system32\regedt32.exe
Assistência Remota
Receba ou ofereça ajuda para seus amigos remotamente.
Comando:
%systemroot%\system32\msra.exe
Restaurar do sistema
Meio que uma máquina do tempo do seu Windows, ajuda a resolver problemas voltando no tempo.
Comando:
%systemroot%\system32\rstrui.exe
- Ljn
- Idade : 51
Re: Botão em HTA
Qui Set 12, 2013 8:30 pm
Boa noite,
Agradeço sua ajuda, este exemplo será muito útil.
Obrigado.
Fica com Deus.
Agradeço sua ajuda, este exemplo será muito útil.
Obrigado.
Fica com Deus.
Permissão deste fórum:
Você não pode responder aos tópicos neste fórum