Bat file
Moderator: DosItHelp
Bat file
Hi
Can someone help me to create a .bat that makes my cmd ask for a login and password when the User or anyone else open it ? (is this possible?).
If the above isnt possible then a .bat dat makes the "echo" always "on" so that way everytime the cmd needs something, it will ask to the User.
Im using
Windows 8 Single Language
Sublime text editor
Thanks for anyone who read this
Can someone help me to create a .bat that makes my cmd ask for a login and password when the User or anyone else open it ? (is this possible?).
If the above isnt possible then a .bat dat makes the "echo" always "on" so that way everytime the cmd needs something, it will ask to the User.
Im using
Windows 8 Single Language
Sublime text editor
Thanks for anyone who read this
Re: Bat file
This might help you:
http://www.dostips.com/forum/viewtopic.php?f=3&t=6834#p44337
You need to store the linked MD5 Algorithm as "md5.bat".
penpen
http://www.dostips.com/forum/viewtopic.php?f=3&t=6834#p44337
You need to store the linked MD5 Algorithm as "md5.bat".
penpen
Re: Bat file
Thank you.......that was something I didn't know..
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
Put this at the begining of the login section
Where the Password is Welcome put what you want the password to be
Kind Regards
Code: Select all
@echo off
color 4f
cls
set "psCommand=powershell -Command "$pword = read-host 'Enter Password' -AsSecureString ; ^
$BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword); ^
[System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR)""
for /f "usebackq delims=" %%p in (`%psCommand%`) do set password=%%p
if "%password%"=="Welcome" goto m
goto X
:X
cls
echo INCORRECT PASSWORD
echo ACCESS DENIED
pause
exit
:M
echo Welcome
Pause
cls
exit
Where the Password is Welcome put what you want the password to be
Kind Regards
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
and to hide the code compile the batch file into an exe file using batch to exe software that way no one can change the password or view it for that matter.
Hope this helps someone
Hope this helps someone
Re: Bat file
NorfolkBatch wrote:compile the batch file
Batch code can't be compiled. Bat2Exe programs just pack the script into something like a self-extracting archive or an installer. It has to be extracted in order to be executable.
NorfolkBatch wrote:no one can change the password or view it
That's wrong. At least during runtime you will find your original code somewhere in the Temp folder. (Besides of all the other possible side effects that I wrote a hundred times before.)
Steffen
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Bat file
NorfolkBatch wrote:and to hide the code compile the batch file into an exe file using batch to exe software that way no one can change the password or view it for that matter.
Hope this helps someone
If you're storing your passwords in plaintext, you're doing it wrong.
Salt and hash your passwords
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
Here is the site site to visit, http://www.f2ko.de/en/b2e.php
Last edited by NorfolkBatch on 05 Aug 2017 01:05, edited 1 time in total.
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
aGerman wrote:NorfolkBatch wrote:compile the batch file
Batch code can't be compiled. Bat2Exe programs just pack the script into something like a self-extracting archive or an installer. It has to be extracted in order to be executable.NorfolkBatch wrote:no one can change the password or view it
That's wrong. At least during runtime you will find your original code somewhere in the Temp folder. (Besides of all the other possible side effects that I wrote a hundred times before.)
Steffen
Incorrect it does not store the password it simply refers it it in the code nothing shows at run-time check it out
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
ShadowThief wrote:NorfolkBatch wrote:and to hide the code compile the batch file into an exe file using batch to exe software that way no one can change the password or view it for that matter.
Hope this helps someone
If you're storing your passwords in plaintext, you're doing it wrong.
Salt and hash your passwords
How it works is that it is written to the code inside the batch file then converted to a exe file which hides the code as exe files can not show the code.
so when run it looks for the code inside the batch file, Now i don't claim to have written the code but I know it works I have been writing code for a long time now, and have learned much about batch files as it was my Favorited subject I personally have written the ultimate batch file and it does everything you could possible what it to do. I love to learn new things and that is why I am passionate about the subject as I understand it so well
Kind Regards
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Bat file
NorfolkBatch wrote:aGerman wrote:NorfolkBatch wrote:compile the batch file
Batch code can't be compiled. Bat2Exe programs just pack the script into something like a self-extracting archive or an installer. It has to be extracted in order to be executable.NorfolkBatch wrote:no one can change the password or view it
That's wrong. At least during runtime you will find your original code somewhere in the Temp folder. (Besides of all the other possible side effects that I wrote a hundred times before.)
Steffen
Incorrect it does not store the password it simply refers it it in the code nothing shows at run-time check it out
But if the script is open long enough for a user to find it (like if the script asks for the user to input a password, for example), the original script can be found in the Temp folder and if you're storing the password in plain text behind an exe converter, it can easily be seen.
Re: Bat file
NorfolkBatch wrote:Incorrect
Nope. I told you how it works and ShadowThief already posted a screenshot. As long as you have commands in your code that wait for user interaction (like SET /P, CHOICE, PAUSE, ...) you have all the time in the world to search and find it on your hard drive (and usually you will find it in the Temp folder). I checked it out a hundred times. Furthermore you don't think of all the drawbacks and side effects caused by the fact that the script is executed in a different folder, caused by the fact that it is executed in WOW64 mode (on 64 Bit machines), caused by the fact that antivirus software might consider the created exe file as False Positive, etc.
Steffen
-
- Posts: 10
- Joined: 03 Aug 2017 22:49
Re: Bat file
OK I am no longer wasting any more time on this subject you clearly don't understand code here and are to ignorant and uneducated to understand how it works have it your way but the code works and well in my opinion noticed you cant answer any real batch coding questions here as I suspected you don't understand nothing about batch scripting.
Rant Over
By
Rant Over
By
-
- Expert
- Posts: 1166
- Joined: 06 Sep 2013 21:28
- Location: Virginia, United States
Re: Bat file
Obvious troll is obvious