Page 1 of 1 1
Topic Options
#7471 - 2001-03-09 05:30 PM MD command w/ LFN's
Anonymous
Unregistered


Greetings!

Hopefully someone will be kind enough to help me on this one. I need a way to script the creation of directories with long file names with spaces; i.e. MD s:\long file name\long file name 2. This is no big deal from a shell but variables obtained from user input need to be passed to the command.
My first efforts of MD "s:\Current Clients\Client 1" results in a folder named Current being created on a drive mapped to s:.
Thanks for any input!

Sean

Top
#7472 - 2001-03-09 08:03 PM Re: MD command w/ LFN's
Anonymous
Unregistered


Hi,

I hope I understood what You want ( I come from bavaria). Following example could help You.

md "My Folder" ;creates the folder "My Folder"
or
md "The Folder of @UserId" ;creates the folder "The Folder of Username"

Tom

Top
#7473 - 2001-03-09 08:59 PM Re: MD command w/ LFN's
Anonymous
Unregistered


I can see how that could/should work. However I am having problems when specifying the drive to create the folders on when using long file names.
Issuing the command
MD "S:\Current Clients\AOL\Awards"
Gives a single folder of S:\Current. It seems that the long file names are being dropped.

Any ideas?
Sean

Top
#7474 - 2001-03-09 09:53 PM Re: MD command w/ LFN's
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
Sean,

Does the folder "S:\Current Clients" all ready exist?

Are you trying to create the entire folder tree "S:\Current Clients\AOL\Awards" in one command?

Bryce

Top
#7475 - 2001-03-09 09:56 PM Re: MD command w/ LFN's
Anonymous
Unregistered


Thanks for your reply Bryce.

The folder does not exist, but I would like to use a script to create an entire directory structure based on user input at the client level. Future commands *will* be dealing with an existing folder.

Thanks!

Sean

Top
#7476 - 2001-03-09 10:19 PM Re: MD command w/ LFN's
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
You will have to shell out and use the MD from the %comspec%, not use Kix's built in MD command.

example:
shell '%comspec% /c md "u:\long folder name\sub folder\"'

Bryce

Top
#7477 - 2001-03-09 11:23 PM Re: MD command w/ LFN's
Anonymous
Unregistered


Got it. Onward to assigning security and this is a done deal. Thanks for everyone's help on this!

Sean

It's a little "chunky" but it works. Here is what I did:

cls
USE S: /DEL
USE S: \\sti_nt02\clients

color b+/n

:start
cls
color g+/n
? "Type the name of the company to create folders for the press Enter : "
? "Press Enter only to end."
color w+/n
? gets $coname

if $coname = ""
goto end
endif
color g+/n
? "Is this a [C]urrent for [F]ormer client? : "
color w+/n
? gets $gen

if $gen = "C"
goto current
else
goto former
endif


:current
s:
CD ..
CD "Current Clients"
MD $coname
CD $coname
MD "Awards"
MD "Case Studies"
CD "Case Studies"
MD "Drafts"
MD "Final"
CD ..
MD "Contributed Articles"
CD "Contributed Articles"
MD "Drafts"
MD "Final"
CD ..
MD "Editorial Calendars"
MD "General Correspondence"
MD "Graphics"
MD "Media Lists"
MD "Media Training"
MD "Meetings"
MD "Miscellaneous"
MD "Pitches"
MD "Presentations"
MD "Press Kit"
CD "Press Kit"
MD "Drafts"
MD "Final"
CD ..
MD "Press Release"
CD "Press Release"
MD "Drafts"
MD "Final"
CD ..
MD "Speaking Opportunities"
MD "Status Reports"
MD "Strategies"
MD "Tradeshow-Tours"
MD "Trimetrics"
MD "White Papers"
CD "White Papers"
MD "Drafts"
MD "Final"
CD \
goto start

:former
s:
CD ..
CD "Former Clients"
MD $coname
CD $coname
MD "Awards"
MD "Case Studies"
MD "Contributed Articles"
MD "Editorial Calendars"
MD "General Correspondence"
MD "Graphics"
MD "Media Lists"
MD "Media Training"
MD "Meetings"
MD "Miscellaneous"
MD "Pitches"
MD "Presentations"
MD "Press Kit"
MD "Press Release"
MD "Speaking Opportunities"
MD "Status Reports"
MD "Strategies"
MD "Tradeshow-Tours"
MD "Trimetrics"
MD "White Papers"
CD \
goto start

:end

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.052 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org