set myDate=%date:~4,2%%date:~7
Main Topics
Browse All TopicsTwo part question:
(1) [175 pts]
In order to automate some tasks I have that require opening several Windows programs, I dumped them into a DOS batch file to open the programs.
This works relatively well, but some programs halt the execution of the batch file until they are closed. After I close them, then the batch file continues. This is fine for some things but not others. Besides, I can always add a pause if I want that function.
I've played around a bit and found that if I launch the program in a separate shell (via the start command) then all is well...unless the command requires parameters.
Q:
How do I create a batch file of windows commands that does not pause until the program closes.
For example, this is what I have, and it pauses after notepad and SecureCRT but the rest open as soon as SecureCRT closes. If I prepend "start" then the parameters are ignored and it simply launches a new blank DOS window.
Myfile.bat
-----------
@Rem Add text file to folder
cd "C:\SomePath\ADC"
Notepad "ADCLog_yyyymmdd.txt"
@Rem Open the SecureCRT window to start DMR
cd "C:\Program Files\SecureCRT3.3\"
SecureCRT.EXE /S "Run ADC"
@Rem Open the bulk folders
explorer "C:\SomePath\ADC"
@Rem Launch the edit tool
cd "C:\Program Files\SlickEdit\win"
start vs.exe
@Rem Launch the claim converter
cd "C:\SomePath\ADC"
adc_regtest.xlt
@Rem Launch the FTP tool
cd "C:\Program Files\GlobalSCAPE\CuteFTP 8 Professional"
start cuteftppro.exe
----------
(2) [75pts]
Is there a way that I can get the current system date (in yyyymmdd format) into a variable so I can add it to a batch command (specifically, to create a text file with the current date: xxxx_yyyymmdd.txt)
Currently I'm donig this:
Notepad xxxx_yyyymmdd.txt
but i'd like the actual date there.
--
If either of these is more complicated than a simple command, I'll up the points.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: sirbountyPosted on 2007-01-31 at 13:25:04ID: 18439792
Try this:
@Rem Add text file to folder
cd "C:\SomePath\ADC"
Start "" Notepad ADCLog_yyyymmdd.txt
@Rem Open the SecureCRT window to start DMR
cd "C:\Program Files\SecureCRT3.3\"
Start "" SecureCRT.EXE /S "Run ADC"
@Rem Open the bulk folders
Start "" explorer "C:\SomePath\ADC"
@Rem Launch the edit tool
cd "C:\Program Files\SlickEdit\win"
start vs.exe
@Rem Launch the claim converter
cd "C:\SomePath\ADC"
adc_regtest.xlt
@Rem Launch the FTP tool
cd "C:\Program Files\GlobalSCAPE\CuteFTP 8 Professional"
start cuteftppro.exe