Solved

make a directory

Posted on 2004-04-23
3
135 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows 8 in a W2K Domain 7 596
VSS on host & VM 10 423
Dell PowerEdge raid drive replacement 13 526
Terminal 2000 connection RDP 5 141
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…
Determining the an SCCM package name from the Package ID
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 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