views:

323

answers:

1

Hi,

I want to map a clearcase view on network drive inside a windows service.
I have tried with net use command, but it did not work properly.

+1  A: 

You should be able to do a

net share X: c:\path\to\my\View # for snapshot view
net share X: M:\myView # for dynamic view

in order to map a view to a drive letter.

This should work from within a service, provided:

  • you are using your Windows account (and not the "Local System account")
  • the dynamic view is already started (and visible in the M:\ MVFS mounting point drive)
VonC
Does using your account to map a drive still work under W7? I haven't had to do it yet.
Paul Nathan
@Paul: not sure. I am at work right now, so I use Windows Xp. Plus ClearCase does not yet support *officially* W7.
VonC
@VonC: Very true and a good point. But I think W7 support comes out Real Soon Now, so it's something to consider (unless of course the box can be dedicated to XP for the term of the system's lifetime).
Paul Nathan
Hi VonC,i am using windows service in LocalSystem account.i have mapped clearcase view on "P:" drive on machine A. and i want to map the same clearcase view on machine B on "P:" drive, but using windows service. how can i do that? i had used 'Net use' command, and it did not work.
ankit
@ankit: that is my point. You should not use `net use` but `net share`. Note: if the goal is to map that path at each windows session, it would be easier to encapsulate that in a script and copy that script in the startup directory of your profile, to make the share each time you log-in. (`C:\Document and Settings\MyLogin\Start Menu\Programs\Startup` or `C:\Users\MyLogin\Start Menu\Programs\Startup`)
VonC
@Vonc: here i have dynamic scenario.what i want is, i want to map a diffenrent view for the application.Means at some time my application will access View1 and after finishing it, it may want to access View2. So, here i need to change the view name for the same user session inside Windows Service.
ankit
@ankit: could you explain to me why a "Widows Service" is needed here? Anyway: to remove an existing share, just do a `net share P: /DELETE`, and then make your new share to the View2. That can be made by scripts in $PATH and easily called from a DOS session.
VonC