Solved

make a directory

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

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 case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

820 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