Reputation: 3
Where I work, I maintain some sensitive data that I like to be able to backup at the click of a batch file. This batch file scans through the files and only copies new and modified files, and deletes files that are no longer in the source. It is probably overkill, but I'm paranoid, so I wanted to mask my input when I type in the password for this script. I found this
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>hide.com
on the internet, and incorporated it, and it does exactly what I wanted it to do. The only problem is that right above where I enter the password, it says "Access is denied." I have it narrowed down to the line above, but I cannot figure out why it says "Access is denied. Enter password:"
Here is my entire script:
@echo off
Title blahblahblah
echo This batch file is designed to backup the "blahblahblah" folder.
echo Upon entering the correct password, all new or modified files and directories
echo will be backed up in drive:\destination. If you want to quit, type exit.
echo WARNING: Any files deleted from the source will be deleted from the destination!
echo ---
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>hide.com
:retry
set /p password=Enter password: <nul
for /f "tokens=*" %%i in ('hide.com') do set password=%%i
if /i %password%==blahblahblah goto main
if /i %password%==exit goto exit
cls
echo Try again. You are not logged in!
goto retry
:main
robocopy "drive:\source" "drive:\destination" /E /Purge
del %USERPROFILE%\Desktop\hide.com
pause
Any help with this would be much appreciated. I don't know if I'm the only one getting the message, or just the only one who is annoyed by it, but I will fully admit that I am not savvy enough at this to be able to decipher that line of code.
Upvotes: 0
Views: 150
Reputation: 56180
It seems, you are starting your batchfile in a directory without write access (for example starting it as administrator would do that)
Try this line:
echo hP1X500P[PZBBBfh#b##fXf-V@`$fPf]f3/f1/5++u5>%USERPROFILE%\Desktop\hide.com
PS: the desktop might not be the best place to hide a file.
Upvotes: 0