Question:
MS Dos Commands Project HELP?
jayjay7182004
2010-06-11 13:38:58 UTC
These directories are only set up on one test and one production server. We would like to have a job we can use to allocate these directories on a different server in case we would need to switch to a different server. Below is a list of the directories we would need. For each set of directories we would also need the higher lever directory allocated, i.e.. For the MDMSPROJECT\PPL_BILL_REQUESTS\FAILED - LOADED - SQLLDR directories we would also have to have the MDMSPROJECT\PPL_BILL_REQUEST directory created first.

Help out Please? Advice & hints. :d

D:\MDMSPROJECT\PPL_BILL_REQUESTS\FAILED
D:\MDMSPROJECT\PPL_BILL_REQUESTS\LOADED
D:\MDMSPROJECT\PPL_BILL_REQUESTS\SQLLDR
D:\MDMSPROJECT\PPL_CSS_CUST_ACCT\EXCLUDE
D:\MDMSPROJECT\PPL_CSS_CUST_ACCT\FAILED
D:\MDMSPROJECT\PPL_CSS_CUST_ACCT\LOADED
D:\MDMSPROJECT\PPL_CSS_CUST_ACCT\SQLLDR
D:\MDMSPROJECT\PPL_CSS_METER\EXCLUDE
D:\MDMSPROJECT\PPL_CSS_METER\FAILED
D:\MDMSPROJECT\PPL_CSS_METER\LOADED
D:\MDMSPROJECT\PPL_CSS_METER\SQLLDR
D:\MDMSPROJECT\PPL_CSS_PREMISE\EXCLUDE
D:\MDMSPROJECT\PPL_CSS_PREMISE\FAILED
D:\MDMSPROJECT\PPL_CSS_PREMISE\LOADED
D:\MDMSPROJECT\PPL_CSS_PREMISE\SQLLDR
D:\MDMSPROJECT\PPL_DATA_TRANSFER\FAILED
D:\MDMSPROJECT\PPL_DATA_TRANSFER\LOADED
D:\MDMSPROJECT\PPL_LMPP_PRICE\FAILED
D:\MDMSPROJECT\PPL_LMPP_PRICE\LOADED
D:\MDMSPROJECT\PPL_LOADSTUDY_BILLING_TOTALIZATION_RESULTS\FAILED
D:\MDMSPROJECT\PPL_LOADSTUDY_BILLING_TOTALIZATION_RESULTS\LOADED
D:\MDMSPROJECT\PPL_MV90\FAILED
D:\MDMSPROJECT\PPL_MV90\INFO Files
D:\MDMSPROJECT\PPL_MV90\LOADED
D:\MDMSPROJECT\PPL_NYPA_GENERATION_DATA_LOAD\FAILED
D:\MDMSPROJECT\PPL_NYPA_GENERATION_DATA_LOAD\LOADED
D:\MDMSPROJECT\PPL_PJM_ZONAL_LOAD\FAILED
D:\MDMSPROJECT\PPL_PJM_ZONAL_LOAD\LOADED
D:\MDMSPROJECT\PPL_PRS_RTO_TOTALIZATION_RESULTS\FAILED
D:\MDMSPROJECT\PPL_PRS_RTO_TOTALIZATION_RESULTS\LOADED
D:\MDMSPROJECT\PPL_READS_ONLY_TNS_DAILY_SHIFT\FAILED
D:\MDMSPROJECT\PPL_READS_ONLY_TNS_DAILY_SHIFT\LOADED
D:\MDMSPROJECT\PPL_SHOPPER_TOTALIZATION_RESULTS\FAILED
D:\MDMSPROJECT\PPL_SHOPPER_TOTALIZATION_RESULTS\LOADED
D:\MDMSPROJECT\PPL_TNS_15_MIN\FAILED
D:\MDMSPROJECT\PPL_TNS_15_MIN\LOADED
D:\MDMSPROJECT\PPL_TNS_60_MIN\FAILED
D:\MDMSPROJECT\PPL_TNS_60_MIN\LOADED
D:\MDMSPROJECT\PPL_TNS_BLINK\FAILED
D:\MDMSPROJECT\PPL_TNS_BLINK\LOADED
D:\MDMSPROJECT\PPL_TNS_DAILY_SHIFT\FAILED
D:\MDMSPROJECT\PPL_TNS_DAILY_SHIFT\LOADED
D:\MDMSPROJECT\PPL_TNS_TAMPER\FAILED
D:\MDMSPROJECT\PPL_TNS_TAMPER\LOADED
D:\MDMSPROJECT\PPL_WEATHER\FAILED
D:\MDMSPROJECT\PPL_WEATHER\LOADED
D:\MDMSPROJECT\PPL_WEATHER_OUTPUT\FAILED
D:\MDMSPROJECT\PPL_WEATHER_OUTPUT\LOADED
D:\MDMSPROJECT\PPL_WV_SCADA\FAILED
D:\MDMSPROJECT\PPL_WV_SCADA\LOADED
D:\MDMSPROJECT\PPL_WV_SCADA\SQLLDR

Hints & tips
Three answers:
?
2010-06-11 14:05:46 UTC
This would be really easy to do in cygwin, or using UnixUtils for Windows:



http://www.cygwin.com/

http://unxutils.sourceforge.net/



Download it, then you can generate a script with it:



cd D:\MDMSPROJECT

find * -type d | awk '{ print ( "mkdir "$1 ); }' > gen_dirs.csh



(Make sure it's using the unix flavor of find, not the windows command find.exe)



Now, whenever you need to generate the directory, can just copy gen_dirs.csh to the root directory, and use it from there - if you're in a windows cmd prompt, call it gen_dirs.bat and if you're in cygwin, add the line #!/bin/csh to the beginning of the file.
Chris C
2010-06-11 14:09:53 UTC
I just tried this in a batch form:

for %%v in ("C:\Users\Chris\Documents\tst" "C:\Users\Chris\Documents\tst\tst1"

"C:\Users\Chris\Documents\tst\tst2") do mkdir %%v



You'll notice that you can span multiple lines for the directory listing to get all the directories created.

This way, you can create the main directory and each sub-directory below it. Make sure as I did that you create the higher directories first.



You'll also notice that because it's a batch file that there are two percent ('%') signs in front of the variable name.
?
2016-04-12 13:01:09 UTC
add option /p meaning pause after each screen, but require a key hiting after each page.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...