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
zarfs

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
Slartybart

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

Yes

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
zarfs

Windows 7, 64-bit
 
 
It works fine

Many, many thanks.
My System SpecsSystem Spec
.

15 Jun 2014   #4
Slartybart

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
Reply

 Can a batch file pause to enter a password?




Thread Tools




Similar help and support threads
Thread Forum
Enter Network Credentials: What username/password do I enter?
I regularly use my laptop over the wireless network to access folders on my desktop machine - both are Win 7. Today I bought a new Win 10 laptop and when I try accessing the desktop machine, the new Win 10 laptop asks for UN/PW via the dialog "Enter network credentials." I have no idea what...
Network & Sharing
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 Network Credentials...what username/password do I enter??
I created a shared folder on a Windows 7 laptop on my network and I'm trying to connect to it with this Windows 10 laptop. I am being prompted to enter a un/pw and have no idea what to enter. The account on the Windows 7 laptop doesn't have a password.
Network & Sharing
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 23:59.
Twitter Facebook Google+