Solved

make a directory

Posted on 2004-04-23
3
133 Views
Last Modified: 2010-04-13
Hello
Haw can i make a directory remotly.
I have a login script how can i in logon script say
if the directory test exist on c:<then make a test2 under test
if not exist then mkdir on d:\test\test2
0
Comment
Question by:sBahman
  • 2
3 Comments
 
LVL 6

Expert Comment

by:salvagbf
ID: 10900330
I'm assuming that you want to use a logon script to test and create a directory on a remote machine running that logon script. The following batch file will do that.  You can either call it from your logon batch file or include it right in the batch file.


@echo off
if exist c:\testdir\nul md c:\testdir\test2
if not exist c:\testdir\nul md c:\testdir md c:\testdir\test2


The 'nul' isn't a file or folder or anything, it's just used to see if the directory actually exists
0
 

Author Comment

by:sBahman
ID: 10925976
Thank you very much
if exist c:\testdir\null md c:\testdir\test2
" otherwise the directory is in d:\test (sure)
else d:\testdir\test2  ???
 
0
 
LVL 6

Accepted Solution

by:
salvagbf earned 20 total points
ID: 10927884
Remember, only one L in nul !

if exist c:\testdir\nul md c:\testdir\test2
This says that if the directory testdir exists on the C:\ drive, make the directory test2 in the directory testdir

if not exist c:\testdir\nul md c:\testdir md c:\testdir\test2
This says that if the directory testdir doesn't exist on the C:\ drive, then make the directory testdir in C:, then make the directory test2 in testdir

d:, c: are interchangeable of course.
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
For months I had no idea how to 'discover' the IP address of the other end of a link (without asking someone who knows), and it drove me batty. Think about it. You can't use Cisco Discovery Protocol (CDP) because it's not implemented on the ASAs.…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now