Solved

make a directory

Posted on 2004-04-23
3
131 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
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…

895 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

17 Experts available now in Live!

Get 1:1 Help Now