Solved

make a directory

Posted on 2004-04-23
3
130 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

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…
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

18 Experts available now in Live!

Get 1:1 Help Now