Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Can a batch file pause to enter a password?

11 Jun 2014   #1

Windows 7, 64-bit
Can a batch file pause to enter a password?

I use Windows 7 Pro.

I have made a batch file to quickly back up certain files.

If I need to encrypt a backed-up file, I use WinZip to compress and encrypt it.

To encrypt, WinZip requires that you manually specify a password. This password must be entered repeatedly throughout the batch file. I'd like the batch file to pause the first time, wait for me to enter the password, then proceed, automatically entering that password whenever it is requested again.

Can this be done?

PS: I used to specify the password in the batch file itself, but that's not very secure. Anyone viewing the batch file could discern the password.

My System SpecsSystem Spec
11 Jun 2014   #2

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem


set /p variable= [string]

set /p secretword= Enter the secret word and win 100 dollars

Note there is a space before the prompt string, but no space after the variable
Then you can use the variable %secretword% throughout your bat file.
My System SpecsSystem Spec
15 Jun 2014   #3

Windows 7, 64-bit
It works fine

Many, many thanks.
My System SpecsSystem Spec

15 Jun 2014   #4

x64 (6.3.9600) Win8.1 Pro & soon dual boot x64 (6.1.7601) Win7_SP1 HomePrem

Glad to have helped and thank you for marking your thread solved.
My System SpecsSystem Spec

 Can a batch file pause to enter a password?

Thread Tools

Similar help and support threads
Thread Forum
Network file sharing without evehaving to enter user name and password
I have noted a number of threads mentioning this issue but cannot see the precise solution I need. I have networked two (and sometimes three) XP PCs and one Win 7 Home Premium 64 PC on a wired domestic network. File sharing is fine, except that I have to enter the Win 7 user name and password...
Network & Sharing
Enter Key as Password?
So i have seen on some computers, that they can use the Enter Key as the password itself, like there is no password, just press enter, but the password field still pops up so that one can enter a password, but i dont want any password in the password field, just the enter button on my keyboard, i...
Need to re-enter WPA password each time
Yes, sign-on automatically is checked, but at each sign-on it only connects to wifi when I re-enter the WPA password. Looking over this site, I see this is a known issue, but most solutions seem to require going to the network map. And mine is blank! Control Panel / Network and Internet /...
Network & Sharing
How to run a batch file at logoff & some batch scripting help please
Hiya, I'd just like to run a simple batch file at logoff to backup some settings. I plan to use Robocopy, which is what i use to more thorough backups. Two questions: 1. How make it run by clicking Start > Shutdown? (i realise i could make a shutdown batch file and run it instead, but i'd...
Backup and Restore
File share without having to enter password
Now I'm wasting time trying to transfer a file from my older win7 laptop to my new win7 desktop. I can send whatever I want from the newer to the older but when I try to look into the newer machine from the older it wants a username and password????? I can't find anywhere in the newer machine that...
Network & Sharing
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 15:50.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App