Computing.Net > Forums > Programming > Batch file user input for file name

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file user input for file name

Reply to Message Icon

Name: Howkoss
Date: February 23, 2009 at 13:23:34 Pacific
OS: Windows Vista
Subcategory: Batch
Comment:

Does this exist?
1- ask user for filename for .pst file.
2- Copy to users Outlook default location
3- Ask again.
4 Open these pst files in Outlook.

Thank you



Sponsored Link
Ads by Google

Response Number 1
Name: stephenturns
Date: February 23, 2009 at 21:12:45 Pacific
Reply:

Im not too sure exactly what your are after. This will prompt for the filename and copy it to a folder but will not open outlook:

@echo off
:FILENAME
set /p filename=What is the filename:
set /p yn=Are you sure [y/n]?
if "%yn%"=="" (echo Not entry) & (GOTO FILENAME)
if /I "%yn%"=="n" (GOTO FILENAME)
if /I "%yn%"=="y" (GOTO LOCATION) else (echo Entry not y or n!) & (GOTO FILENAME)

:LOCATION
copy %filename%.pst "c:\Outlook default location"

:END
echo.
set yn=
set /p yn=Do this again [y/n]?
if "%yn%"=="" (echo Not entry) & (GOTO END)
if /I "%yn%"=="n" (GOTO QUIT)
if /I "%yn%"=="y" (GOTO FILENAME) else (echo Entry not y or n!) & (GOTO END)

:QUIT
EXIT


0

Response Number 2
Name: Howkoss
Date: March 5, 2009 at 14:31:17 Pacific
Reply:

Thank you. I will try it out. Sorry I got very busy.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file user input for file name

Hiding user input in a Batch File www.computing.net/answers/programming/hiding-user-input-in-a-batch-file/15928.html

Batch file variable creation www.computing.net/answers/programming/batch-file-variable-creation/14564.html

Batch file - export current time www.computing.net/answers/programming/batch-file-export-current-time/16555.html