Ir ao conteúdo

Posts recomendados

Postado

Bem... Gostaria de transforma um arquivo .bat em um .exe, mas estou tendo dificuldades :tw_cold_sweat:

Ja tentei usar o Iexpress, mas depois que ouve a conversao o arquivo .exe meio que nao funciona

Alguem poderia me dar dicas de programas ou algo do tipo?

Obrigado :tw_heart:

Postado

Não entendi a sua resposta. 

 

Não sei porque utiliza emoticons sendo que pode se expressar melhor através da escrita

 

Aqui pra mim esse conversor converteu um arquivo com extensão *.bat para *.exe, perfeitamente. 

 

Se não é isso que precisa explique melhor o que precisa, por favor. 

 

 

 

 

 

 

  • Curtir 1
Postado
Postado

cls
@ECHO Off
title Bloquear Acesso a Pasta!!!
if EXIST "Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
:CONFIRM
color 2
echo ######   ##         ###       ###    ##     ## #######    ###
echo ##    ## ##       ##   ##   ##   ##  ##     ## ##       ##   ##
echo ##    ## ##      ##     ## ##     ## ##     ## ##      ##     ##
echo ######   ##      ##     ## ##     ## ##     ## #####   ##     ##
echo ##    ## ##      ##     ## ##     ## ##     ## ##      ## ### ##
echo ##    ## ##       ##   ##   ##   ##   ##   ##  ##      ##     ##
echo ######   ########   ###        ##       ###    ####### ##     ##
echo                                  ##
echo Tem certeza, que deseja bloquear a pasta? (Y/N)
set /p "cho="
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Comando Invalido.
pause > nul
goto CONFIRM


:LOCK
ren "Private" "Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"
echo Folder locked
goto End


:UNLOCK
cls
color 7
echo Digite a senha para desbloquear a pasta Private!!!
set /p "pass="
if NOT %pass%== 123 goto FAIL
ren "Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}" "Private"
cls
color 2
echo !!! PASTA DESBLOQUEADA !!!
echo    Sair? aperte (ENTER)
set /p "cho="
if %cho%==enter goto ENTER
goto End


:RELOCK
color c
echo Tentar Novamente? (Y/N)
set /p "cho="
if %cho%==Y goto UNLOCK
if %cho%==y goto UNLOCK
if %cho%==n goto END
if %cho%==N goto END
pause > nul
goto UNLOCK


:FAIL
cls
echo Senha Invalida
goto RELOCK


:MDLOCKER
md Private
color 2
echo A Pasta Private Foi Criada Com Sucesso!!!
echo Avancar aperte ENTER!!!
pause > nul
cls
goto CONFIRM


:End

:ENTER
exit
 

 

Esse é um arquivo .BAT no qual se oculta os arquivos(achei em um tropico na net)

Postado

Ok, vamos lá, eu utilizei o código abaixo adaptado para o ambiente vb6 (visual basic 6) e compilei sem o form.

 

Se quiser testar o código abaixo é só colar em um modulo padrão do excel salvar o arquivo e rodar.pois esta adaptado ao vba. A macro criará um *bat na mesma pasta da planilha.em seguida roda o *bat e for fim deleta. 

Public Sub Main()
Dim MyFile As String

On Error GoTo Erro

'MyFile = VB.App.Path & "\SeuBat.bat"
MyFile = ThisWorkbook.Path & "\SeuBat.bat"

fnum = FreeFile()

Open MyFile For Output As #fnum

Print #fnum, "cls"
Print #fnum, "@echo off"
Print #fnum, "title Bloquear Acesso a Pasta!!!"
Print #fnum, "if EXIST ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"" goto UNLOCK"
Print #fnum, "if NOT EXIST Private goto MDLOCKER"
Print #fnum, ":CONFIRM"
Print #fnum, "color 2"
Print #fnum, "echo ######   ##         ###       ###    ##     ## #######    ###"
Print #fnum, "echo ##    ## ##       ##   ##   ##   ##  ##     ## ##       ##   ##"
Print #fnum, "echo ##    ## ##      ##     ## ##     ## ##     ## ##      ##     ##"
Print #fnum, "echo ######   ##      ##     ## ##     ## ##     ## #####   ##     ##"
Print #fnum, "echo ##    ## ##      ##     ## ##     ## ##     ## ##      ## ### ##"
Print #fnum, "echo ##    ## ##       ##   ##   ##   ##   ##   ##  ##      ##     ##"
Print #fnum, "echo ######   ########   ###        ##       ###    ####### ##     ##"
Print #fnum, "echo"
Print #fnum, "echo Tem certeza, que deseja bloquear a pasta? (S/N)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==s goto LOCK"
Print #fnum, "if %cho%==n goto END"
Print #fnum, "if %cho%==N goto END"
Print #fnum, "echo Comando Invalido."
Print #fnum, "pause > nul"
Print #fnum, "goto CONFIRM"


Print #fnum, ":LOCK"
Print #fnum, "ren ""Private"" ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"""
Print #fnum, "echo Folder locked"
Print #fnum, "goto End"


Print #fnum, ":UNLOCK"
Print #fnum, "cls"
Print #fnum, "color 7"
Print #fnum, "echo Digite a senha para desbloquear a pasta Private!!!"
Print #fnum, "set /p ""pass="""
Print #fnum, "if NOT %pass%== 123 goto FAIL"
Print #fnum, "ren ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"" ""Private"""
Print #fnum, "cls"
Print #fnum, "color 2"
Print #fnum, "echo !!! PASTA DESBLOQUEADA !!!"
Print #fnum, "echo    Sair? aperte (ENTER)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==enter goto ENTER"
Print #fnum, "goto End"


Print #fnum, ":RELOCK"
Print #fnum, "color c"
Print #fnum, "echo Tentar Novamente? (S/N)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==s goto UNLOCK"
Print #fnum, "if %cho%==S goto UNLOCK"
Print #fnum, "if %cho%==n goto END"
Print #fnum, "if %cho%==N goto END"
Print #fnum, "pause > nul"
Print #fnum, "goto UNLOCK"


Print #fnum, ":FAIL"
Print #fnum, "cls"
Print #fnum, "echo Senha Invalida"
Print #fnum, "goto RELOCK"


Print #fnum, ":MDLOCKER"
Print #fnum, "md Private"
Print #fnum, "color 2"
Print #fnum, "echo A Pasta Private Foi Criada Com Sucesso!!!"
Print #fnum, "echo Avancar aperte ENTER!!!"
Print #fnum, "pause > nul"
Print #fnum, "cls"
Print #fnum, "goto CONFIRM"

Print #fnum, ":End"

Print #fnum, ":ENTER"
Print #fnum, "exit"

Close #fnum

'Sleep 5000
Application.Wait VBA.Now + VBA.TimeValue("00:00:05")

If Dir(MyFile, vbDirectory) <> "" Then
' roda bat-file:
Shell MyFile, vbNormalFocus

'Sleep 5000
Application.Wait VBA.Now + VBA.TimeValue("00:00:05")
' remove bat-file:
Kill MyFile
   
End If

Exit Sub

Erro:
If Dir(MyFile, vbDirectory) <> "" Then
Kill MyFile
End If

MsgBox Err.Number & " " & Err.Description

End Sub

 

  • Amei 1
Postado

Só mais uma coisa(se não for muito incomodo) :wiggle:

Poderia concerta esse erro do ECHO está desativo?

Porque tem vezes que ele não "oculta" a pasta e por isso ela continua do mesmo jeito

Suspeito que o problema seja esse

NaoSei.PNG.88e93b21264d234f3522b6e67dfcadc8.PNG

  • Solução
Postado
10 minutos atrás, Angelo Felipe disse:

Só mais uma coisa(se não for muito incomodo) :wiggle:

Poderia concerta esse erro do ECHO está desativo?

Porque tem vezes que ele não "oculta" a pasta e por isso ela continua do mesmo jeito

Suspeito que o problema seja esse

 

:oops:Verdade, acabei comendo bola e escrevi errado esta linha.

 

Segue com a alteracao.  

BatTest.zip

  • Amei 1
Postado
3 minutos atrás, Angelo Felipe disse:

So mais uma coisinha 

Coloca aqui o código que o senhor utilizou por favor

 

Seria o código que compilei ? 

Postado

Segue 

 

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Public Sub Main()
Dim MyFile As String

On Error GoTo Erro

MyFile = VB.App.Path & "\SeuBat.bat"

fnum = FreeFile()

Open MyFile For Output As #fnum

Print #fnum, "cls"
Print #fnum, "@echo off"
Print #fnum, "title Bloquear Acesso a Pasta!!!"
Print #fnum, "if EXIST ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"" goto UNLOCK"
Print #fnum, "if NOT EXIST Private goto MDLOCKER"
Print #fnum, ":CONFIRM"
Print #fnum, "color 2"
Print #fnum, "echo ######   ##         ###       ###    ##     ## #######    ###"
Print #fnum, "echo ##    ## ##       ##   ##   ##   ##  ##     ## ##       ##   ##"
Print #fnum, "echo ##    ## ##      ##     ## ##     ## ##     ## ##      ##     ##"
Print #fnum, "echo ######   ##      ##     ## ##     ## ##     ## #####   ##     ##"
Print #fnum, "echo ##    ## ##      ##     ## ##     ## ##     ## ##      ## ### ##"
Print #fnum, "echo ##    ## ##       ##   ##   ##   ##   ##   ##  ##      ##     ##"
Print #fnum, "echo ######   ########   ###        ##       ###    ####### ##     ##"
Print #fnum, "echo                                  ##"
Print #fnum, "echo Tem certeza, que deseja bloquear a pasta? (S/N)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==s goto LOCK"
Print #fnum, "if %cho%==n goto END"
Print #fnum, "if %cho%==N goto END"
Print #fnum, "echo Comando Invalido."
Print #fnum, "pause > nul"
Print #fnum, "goto CONFIRM"


Print #fnum, ":LOCK"
Print #fnum, "ren ""Private"" ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"""
Print #fnum, "echo Folder locked"
Print #fnum, "goto End"


Print #fnum, ":UNLOCK"
Print #fnum, "cls"
Print #fnum, "color 7"
Print #fnum, "echo Digite a senha para desbloquear a pasta Private!!!"
Print #fnum, "set /p ""pass="""
Print #fnum, "if NOT %pass%== 123 goto FAIL"
Print #fnum, "ren ""Meu computador.{20d04fe0-3aea-1069-a2d8-08002b30309d}"" ""Private"""
Print #fnum, "cls"
Print #fnum, "color 2"
Print #fnum, "echo !!! PASTA DESBLOQUEADA !!!"
Print #fnum, "echo    Sair? aperte (ENTER)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==enter goto ENTER"
Print #fnum, "goto End"


Print #fnum, ":RELOCK"
Print #fnum, "color c"
Print #fnum, "echo Tentar Novamente? (S/N)"
Print #fnum, "set /p ""cho="""
Print #fnum, "if %cho%==s goto UNLOCK"
Print #fnum, "if %cho%==S goto UNLOCK"
Print #fnum, "if %cho%==n goto END"
Print #fnum, "if %cho%==N goto END"
Print #fnum, "pause > nul"
Print #fnum, "goto UNLOCK"


Print #fnum, ":FAIL"
Print #fnum, "cls"
Print #fnum, "echo Senha Invalida"
Print #fnum, "goto RELOCK"


Print #fnum, ":MDLOCKER"
Print #fnum, "md Private"
Print #fnum, "color 2"
Print #fnum, "echo A Pasta Private Foi Criada Com Sucesso!!!"
Print #fnum, "echo Avancar aperte ENTER!!!"
Print #fnum, "pause > nul"
Print #fnum, "cls"
Print #fnum, "goto CONFIRM"

Print #fnum, ":End"

Print #fnum, ":ENTER"
Print #fnum, "exit"

Close #fnum

Sleep 5000

If Dir(MyFile, vbDirectory) <> "" Then
' roda bat-file:
Shell MyFile, vbNormalFocus

Sleep 5000
' remove bat-file:
Kill MyFile
   
End If

Exit Sub

Erro:
If Dir(MyFile, vbDirectory) <> "" Then
Kill MyFile
End If

MsgBox Err.Number & " " & Err.Description

End Sub

 

  • Amei 1

Crie uma conta ou entre para comentar

Você precisa ser um usuário para fazer um comentário

Criar uma conta

Crie uma nova conta em nossa comunidade. É fácil!

Crie uma nova conta

Entrar

Já tem uma conta? Faça o login.

Entrar agora

Sobre o Clube do Hardware

No ar desde 1996, o Clube do Hardware é uma das maiores, mais antigas e mais respeitadas comunidades sobre tecnologia do Brasil. Leia mais

Direitos autorais

Não permitimos a cópia ou reprodução do conteúdo do nosso site, fórum, newsletters e redes sociais, mesmo citando-se a fonte. Leia mais

×
×
  • Criar novo...