<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Automate File Path Configuration in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799944#M30348</link>
    <description>Tom,&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much... this looks great. Just what the doctor ordered.&lt;BR /&gt;
&lt;BR /&gt;
I'll have a play with it today and hopefully that will solve the problem.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
Ian</description>
    <pubDate>Wed, 25 Oct 2006 08:18:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-10-25T08:18:28Z</dc:date>
    <item>
      <title>Automate File Path Configuration</title>
      <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799942#M30346</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
Our IT guys in thier wisdom have moved all of the user profiles from the C: drive to the &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; drive overnight, however they didn't have enough forsight to anticipate that this would screw with AutoCAD's configuration. I have manually mapped about 8 machines in my locality this morning, but we have about 800 staff nationwide...!!! Does anybody know if it is possible to write a script that will automate this process...&lt;BR /&gt;
&lt;BR /&gt;
This will involve capturing the users login the bit immediately after the C:\Documents and settings\xxXXxx\... so that it can be replaced with D:\Documents and Settings\xxXXxx\...&lt;BR /&gt;
&lt;BR /&gt;
Can anybody please give me any pointers or script examples, websites etc...&lt;BR /&gt;
&lt;BR /&gt;
Thanks in anticipation&lt;BR /&gt;
&lt;BR /&gt;
Ian James</description>
      <pubDate>Tue, 24 Oct 2006 14:20:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799942#M30346</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-24T14:20:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automate File Path Configuration</title>
      <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799943#M30347</link>
      <description>There are bits and pieces in here that you should find quite useful (this is &lt;BR /&gt;
from a VBA code module).&lt;BR /&gt;
&lt;BR /&gt;
(Sorry I don't have the time to clip out the exact parts you're asking &lt;BR /&gt;
about.........shouldn't be too hard to distinguish, though.)&lt;BR /&gt;
&lt;BR /&gt;
Dim oAcApp As AcadApplication&lt;BR /&gt;
Dim oAcPref As AcadPreferences&lt;BR /&gt;
Dim sSupPath As Variant&lt;BR /&gt;
Dim vSupPath As Variant&lt;BR /&gt;
Dim vItm As Variant&lt;BR /&gt;
Dim bTst As Boolean&lt;BR /&gt;
&lt;BR /&gt;
  Set oAcApp = ThisDrawing.Application&lt;BR /&gt;
  Set oAcPref = oAcApp.Preferences&lt;BR /&gt;
  With oAcPref.Files&lt;BR /&gt;
    'Check/set Support Files path&lt;BR /&gt;
    sSupPath = .SupportPath&lt;BR /&gt;
    vSupPath = Split(sSupPath, ";")&lt;BR /&gt;
    If UCase(vSupPath(0)) &amp;lt;&amp;gt; "\\servername\cadd\SYM\ACAD06" Then&lt;BR /&gt;
      .SupportPath = "\\servername\cadd\SYM\ACAD06;G:\CECSYM;" &amp;amp; sSupPath&lt;BR /&gt;
    End If&lt;BR /&gt;
    .PrinterConfigPath = "c:\Acad2006\Plotters"&lt;BR /&gt;
    .PrinterDescPath = "c:\Acad2006\Plotters\PMP Files"&lt;BR /&gt;
    .PrinterStyleSheetPath = "\\servername\cadd\SYM\Plot Styles"&lt;BR /&gt;
    .TemplateDwgPath = "\\servername\cadd\YSM\Templates"&lt;BR /&gt;
  End With&lt;BR /&gt;
  With oAcPref&lt;BR /&gt;
    .OpenSave.FullCRCValidation = True&lt;BR /&gt;
    .System.LoadAcadLspInAllDocuments = True&lt;BR /&gt;
    .OpenSave.IncrementalSavePercent = 0&lt;BR /&gt;
  End With&lt;BR /&gt;
  Set oAcPref = Nothing: Set oAcApp = Nothing&lt;BR /&gt;
&lt;BR /&gt;
  Call CheckLocalAcadSupportFiles&lt;BR /&gt;
&lt;BR /&gt;
Sub CheckLocalAcadSupportFiles()&lt;BR /&gt;
Dim sAcadVer As String&lt;BR /&gt;
Dim sAppData As String&lt;BR /&gt;
Dim vAcadPaths() As String 'List of POSSIBLE Acad paths&lt;BR /&gt;
Dim iCnt As Integer&lt;BR /&gt;
Dim sFile As Variant&lt;BR /&gt;
Dim oFso As FileSystemObject, oFile As File&lt;BR /&gt;
  sAcadVer = Application.Version&lt;BR /&gt;
  sAppData = Environ("appdata") 'Returns c:\Documents and &lt;BR /&gt;
Settings\username\Application Data&lt;BR /&gt;
  ReDim vAcadPaths(1)&lt;BR /&gt;
  vAcadPaths(0) = "\Autodesk\Autodesk Land Desktop 2006\R16.2\enu\Support" &lt;BR /&gt;
'Land &amp;amp; Map&lt;BR /&gt;
  vAcadPaths(1) = "\Autodesk\C3D 2006\enu\Support" &lt;BR /&gt;
'Civil 3D&lt;BR /&gt;
  For iCnt = 0 To UBound(vAcadPaths)&lt;BR /&gt;
    sFile = Dir(sAppData &amp;amp; vAcadPaths(iCnt) &amp;amp; "\acad.pat")&lt;BR /&gt;
    If UCase(sFile) = "ACAD.PAT" Then&lt;BR /&gt;
      Set oFso = New FileSystemObject&lt;BR /&gt;
      Set oFile = oFso.GetFile(sAppData &amp;amp; vAcadPaths(iCnt) &amp;amp; "\acad.pat")&lt;BR /&gt;
      'Debug.Print " size of acad.pat: " &amp;amp; oFile.Size&lt;BR /&gt;
      'Original size (2006): 14812    CEC size of acad.pat: 287600&lt;BR /&gt;
      If oFile.Size &amp;lt; 15000 Then&lt;BR /&gt;
        oFso.CopyFile "\\servername\cadd\cecsym\Acad06\acad.pat.---", &lt;BR /&gt;
sAppData &amp;amp; vAcadPaths(iCnt) &amp;amp; "\acad.pat", True&lt;BR /&gt;
        oFso.CopyFile "\\servername\cadd\cecsym\Acad06\acad.slb.---", &lt;BR /&gt;
sAppData &amp;amp; vAcadPaths(iCnt) &amp;amp; "\acad.slb", True&lt;BR /&gt;
      End If&lt;BR /&gt;
      Set oFile = Nothing&lt;BR /&gt;
      Set oFso = Nothing&lt;BR /&gt;
    End If&lt;BR /&gt;
  Next&lt;BR /&gt;
End Sub&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;KELDAR&gt; wrote in message news:5372353@discussion.autodesk.com...&lt;BR /&gt;
Hi,&lt;BR /&gt;
&lt;BR /&gt;
Our IT guys in thier wisdom have moved all of the user profiles from the C: &lt;BR /&gt;
drive to the &lt;span class="lia-unicode-emoji" title=":anguished_face:"&gt;😧&lt;/span&gt; drive overnight, however they didn't have enough forsight to &lt;BR /&gt;
anticipate that this would screw with AutoCAD's configuration. I have &lt;BR /&gt;
manually mapped about 8 machines in my locality this morning, but we have &lt;BR /&gt;
about 800 staff nationwide...!!! Does anybody know if it is possible to &lt;BR /&gt;
write a script that will automate this process...&lt;BR /&gt;
&lt;BR /&gt;
This will involve capturing the users login the bit immediately after the &lt;BR /&gt;
C:\Documents and settings\xxXXxx\... so that it can be replaced with &lt;BR /&gt;
D:\Documents and Settings\xxXXxx\...&lt;BR /&gt;
&lt;BR /&gt;
Can anybody please give me any pointers or script examples, websites etc...&lt;BR /&gt;
&lt;BR /&gt;
Thanks in anticipation&lt;BR /&gt;
&lt;BR /&gt;
Ian James&lt;/KELDAR&gt;</description>
      <pubDate>Tue, 24 Oct 2006 21:18:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799943#M30347</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-24T21:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Automate File Path Configuration</title>
      <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799944#M30348</link>
      <description>Tom,&lt;BR /&gt;
&lt;BR /&gt;
Thanks very much... this looks great. Just what the doctor ordered.&lt;BR /&gt;
&lt;BR /&gt;
I'll have a play with it today and hopefully that will solve the problem.&lt;BR /&gt;
&lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
Ian</description>
      <pubDate>Wed, 25 Oct 2006 08:18:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799944#M30348</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-25T08:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: Automate File Path Configuration</title>
      <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799945#M30349</link>
      <description>This may be all you need&lt;BR /&gt;
[code]&lt;BR /&gt;
Sub SupportPathing()&lt;BR /&gt;
    Dim Preferences As AcadPreferences&lt;BR /&gt;
    Dim Pref As String&lt;BR /&gt;
    Dim SupportPath As String&lt;BR /&gt;
    Dim sNewSupportPath As String&lt;BR /&gt;
    Dim sFind As String, sReplace As String&lt;BR /&gt;
    &lt;BR /&gt;
    Set Preferences = ThisDrawing.Application.Preferences&lt;BR /&gt;
    SupportPath = Preferences.Files.SupportPath&lt;BR /&gt;
    Debug.Print SupportPath&lt;BR /&gt;
    sFind = "C:\Documents and Settings"&lt;BR /&gt;
    sReplace = "D:\Documents and Settings"&lt;BR /&gt;
    sNewSupportPath = Replace(SupportPath, sFind, sReplace)&lt;BR /&gt;
    Debug.Print sNewSupportPath&lt;BR /&gt;
    Preferences.Files.SupportPath = sNewSupportPath&lt;BR /&gt;
End Sub&lt;BR /&gt;
[/code]</description>
      <pubDate>Wed, 25 Oct 2006 13:22:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799945#M30349</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-25T13:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: Automate File Path Configuration</title>
      <link>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799946#M30350</link>
      <description>Thanks,&lt;BR /&gt;
&lt;BR /&gt;
I just finished coding the macro... not as elegant as yours a bit manual, but it does the job.&lt;BR /&gt;
&lt;BR /&gt;
I like your use of Replace... not done that before...&lt;BR /&gt;
&lt;BR /&gt;
But then again not programmed anything for about 6 years&lt;BR /&gt;
&lt;BR /&gt;
Thanks to All for your help&lt;BR /&gt;
&lt;BR /&gt;
Ian James&lt;BR /&gt;
BDP Architects (UK)</description>
      <pubDate>Wed, 25 Oct 2006 13:34:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/automate-file-path-configuration/m-p/1799946#M30350</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-10-25T13:34:58Z</dc:date>
    </item>
  </channel>
</rss>

