Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

624 lines
21 KiB

  1. <%@ Language=VBScript %>
  2. <% Option Explicit %>
  3. <%
  4. '-------------------------------------------------------------------------
  5. ' folder_new.asp : This page serves in creating a new folder
  6. '
  7. ' Copyright (c) Microsoft Corporation. All rights reserved.
  8. '
  9. ' Date Description
  10. ' 17-01-2001 Creation date
  11. ' 21-03-2001 Modified date
  12. '-------------------------------------------------------------------------
  13. %>
  14. <!-- #include virtual="/admin/inc_framework.asp" -->
  15. <!-- #include file="loc_folder.asp"-->
  16. <%
  17. '-------------------------------------------------------------------------
  18. ' Global Variables
  19. '-------------------------------------------------------------------------
  20. Dim rc 'Page variable
  21. Dim page 'Page variable
  22. Dim g_iTabGeneral 'Variable for General tab
  23. Dim g_iTabCompress 'Variable for Compress tab
  24. Dim SOURCE_FILE 'File name
  25. SOURCE_FILE = SA_GetScriptFileName()
  26. '-------------------------------------------------------------------------
  27. ' Form Variables
  28. '-------------------------------------------------------------------------
  29. Dim F_strCompressed 'Value of Compress Checkbox
  30. Dim F_strParentFolderName 'Parent folder name
  31. Dim F_strReadOnly 'Status of Readonly Checkbox
  32. Dim F_strHidden 'Status of Hidden Checkbox
  33. Dim F_strArchive 'Status of Archive Checkbox
  34. Dim F_strChangeOption 'Status of radio button for compression of folder
  35. Dim F_strFolderCompress 'Value of radio button to compress folder
  36. Dim F_strFolderName 'Folder name
  37. Dim F_strPathName 'Folder path
  38. '------------------------------------------------------------------------
  39. 'Localization Variable and Constants
  40. '------------------------------------------------------------------------
  41. Dim L_PAGETITLE_NEW_TEXT 'Page title
  42. Const CONST_ARR_APPLYALLFOLDERS = "ALL"
  43. Const CONST_ARR_APPLYFOLDER = "ONE"
  44. Const CONST_N_SIZEDATA_TEXT = "0"
  45. Const CONST_UNCHECKED_TEXT = "UNCHECKED"
  46. Const CONST_CHECKED_TEXT = "CHECKED"
  47. 'Page Title
  48. L_PAGETITLE_NEW_TEXT = L_TABLEHEADING_TEXT 'Here the parent folder name must be appended
  49. 'Create a Tabbed Property Page
  50. rc = SA_CreatePage(L_PAGETITLE_NEW_TEXT, "", PT_TABBED, page )
  51. 'Add two tabs
  52. rc = SA_AddTabPage( page, L_GENERAL_TEXT, g_iTabGeneral)
  53. rc = SA_AddTabPage( page, L_COMPRESS_TEXT, g_iTabCompress)
  54. 'Show the page
  55. rc = SA_ShowPage( page )
  56. '-------------------------------------------------------------------------
  57. 'Function name: OnInitPage
  58. 'Description: Called to signal first time processing for this page.
  59. 'Input Variables: PageIn,EventArg
  60. 'Output Variables: PageIn,EventArg
  61. 'Returns: TRUE to indicate initialization was successful. FALSE to indicate
  62. ' errors. Returning FALSE will cause the page to be abandoned.
  63. 'Global Variables: Out:None
  64. ' In: None
  65. '--------------------------------------------------------------------------
  66. Public Function OnInitPage(ByRef PageIn, ByRef EventArg)
  67. Call SA_TraceOut(SOURCE_FILE, "OnInitPage")
  68. F_strParentFolderName = replace(Request.QueryString("parent"),"/","\")
  69. 'Setting Folder Compress property to parent folder by default
  70. F_strFolderCompress = CONST_ARR_APPLYFOLDER
  71. Call SA_MungeURL(mstrReturnURL, "PKey", replace(F_strParentFolderName, "\", "/"))
  72. OnInitPage = TRUE
  73. End Function
  74. '-------------------------------------------------------------------------
  75. 'Function name: OnPostBackPage
  76. 'Description: Called to signal that the page has been posted-back.
  77. 'Input Variables: PageIn,EventArg
  78. 'Output Variables: PageIn,EventArg
  79. 'Returns: TRUE to indicate initialization was successful. FALSE to indicate
  80. ' errors. Returning FALSE will cause the page to be abandoned.
  81. 'Global Variables: F_(*), L_(*)
  82. '--------------------------------------------------------------------------
  83. Public Function OnPostBackPage(ByRef PageIn, ByRef EventArg)
  84. Call SA_TraceOut(SOURCE_FILE, "OnPostBackPage")
  85. 'Updating the form variables
  86. F_strFolderName = Trim(Request.form("txtNewFolderName"))
  87. F_strCompressed = Request.Form("chkCompress")
  88. F_strFolderCompress = Request.Form("radFolders")
  89. F_strHidden = Request.Form("chkHidden")
  90. F_strReadOnly = Request.Form("chkReadOnly")
  91. F_strArchive = Request.Form("chkArchive")
  92. F_strParentFolderName = Request.Form("hdnParentFolder")
  93. If F_strFolderCompress = CONST_ARR_APPLYALLFOLDERS Then
  94. F_strChangeOption = Ucase(CONST_CHECKED_TEXT)
  95. Else
  96. F_strChangeOption = UCase(CONST_UNCHECKED_TEXT)
  97. End if
  98. OnPostBackPage = TRUE
  99. End Function
  100. '-------------------------------------------------------------------------
  101. 'Function name: OnServeTabbedPropertyPage
  102. 'Description: Called when the page needs to be served.
  103. 'Input Variables: PageIn,EventArg
  104. 'Output Variables: PageIn,EventArg
  105. 'Returns: TRUE to indicate initialization was successful. FALSE to indicate
  106. ' errors. Returning FALSE will cause the page to be abandoned.
  107. 'Global Variables: None
  108. '--------------------------------------------------------------------------
  109. Public Function OnServeTabbedPropertyPage(ByRef PageIn, _
  110. ByVal iTab, _
  111. ByVal bIsVisible, ByRef EventArg)
  112. 'Emit content for the requested tab
  113. Select Case iTab
  114. Case g_iTabGeneral
  115. Call ServeTabGeneral(PageIn, bIsVisible)
  116. Case g_iTabCompress
  117. Call ServeTabCompress(PageIn, bIsVisible)
  118. Case Else
  119. Call SA_TraceOut(SOURCE_FILE, "OnServeTabbedPropertyPage")
  120. End Select
  121. OnServeTabbedPropertyPage = TRUE
  122. End Function
  123. '-------------------------------------------------------------------------
  124. 'Function name: OnSubmitPage
  125. 'Description: Called when the page has been submitted for processing.
  126. 'Input Variables: PageIn,EventArg
  127. 'Output Variables: PageIn,EventArg
  128. 'Returns: TRUE if the submit was successful, FALSE to indicate error(s).
  129. ' Returning FALSE will cause the page to be served again using
  130. ' a call to OnServePropertyPage.
  131. 'Global Variables: None
  132. '--------------------------------------------------------------------------
  133. Public Function OnSubmitPage(ByRef PageIn, ByRef EventArg)
  134. 'Call CreateNewFolder function to create new folder
  135. OnSubmitPage = CreateNewFolder
  136. End Function
  137. '-------------------------------------------------------------------------
  138. 'Function name: OnClosePage
  139. 'Description: Called when the page is about to be closed.
  140. 'Input Variables: PageIn,EventArg
  141. 'Output Variables: PageIn,EventArg
  142. 'Returns: TRUE to allow close, FALSE to prevent close. Returning FALSE
  143. ' will result in a call to OnServePropertyPage.
  144. 'Global Variables: Out:None
  145. ' In: None
  146. '--------------------------------------------------------------------------
  147. Public Function OnClosePage(ByRef PageIn, ByRef EventArg)
  148. OnClosePage = TRUE
  149. End Function
  150. '-------------------------------------------------------------------------
  151. 'Function name: ServeTabGeneral
  152. 'Description: Serves in selecting the tab1
  153. 'Input Variables: PageIn,bIsVisible
  154. 'Output Variables: PageIn
  155. 'Returns: None
  156. 'Global Variables: gc_ERR_SUCCESS,F_strFolderName,F_(*),L_(*)
  157. '--------------------------------------------------------------------------
  158. Function ServeTabGeneral(ByRef PageIn, ByVal bIsVisible)
  159. If ( bIsVisible ) Then
  160. 'ServeCommonJavaScriptGeneral is called for General tab initialising,validating and set data
  161. Call ServeCommonJavaScriptGeneral()
  162. %>
  163. <table border="0">
  164. <tr>
  165. <td nowrap class = "TasksBody">
  166. <%=L_FOLDERNAME_TEXT%>
  167. </td>
  168. <td class = "TasksBody">
  169. <input class = "FormField" type="text" name="txtNewFolderName" size="10" maxlength="242" value="<%=Server.HTMLEncode(F_strFolderName)%>">
  170. </td>
  171. </tr>
  172. <tr>
  173. <td nowrap class = "TasksBody" >
  174. <%=L_FOLDERTYPE_TEXT %>
  175. </td>
  176. <td nowrap class = "TasksBody">
  177. <%=L_TYPE_TEXT%>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td nowrap class = "TasksBody">
  182. <%=L_FOLDERLOCATION_TEXT %>
  183. </td>
  184. <td class = "TasksBody">
  185. <%=server.HTMLEncode(F_strParentFolderName)%>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td nowrap class = "TasksBody">
  190. <%=L_FOLDERSIZE_TEXT %>
  191. </td>
  192. <td class = "TasksBody">
  193. <%=CONST_N_SIZEDATA_TEXT%>
  194. </td>
  195. </tr>
  196. <tr>
  197. <td nowrap class = "TasksBody">
  198. <%=L_FOLDERCONTAINS_TEXT%>
  199. </td>
  200. <td nowrap class = "TasksBody">
  201. <%=L_CONTAINSDATA_TEXT%>
  202. </td>
  203. </tr>
  204. <tr>
  205. <td class = "TasksBody">
  206. </td>
  207. </tr>
  208. <tr>
  209. <td nowrap class = "TasksBody">
  210. <%=L_FOLDERCEATED_TEXT%>
  211. </td>
  212. <td class = "TasksBody">
  213. </td>
  214. </tr>
  215. <tr>
  216. <td class = "TasksBody">
  217. </td>
  218. </tr>
  219. <tr>
  220. <td nowrap class = "TasksBody">
  221. <%=L_FOLDERATTRIBUTE_TEXT%>
  222. </td>
  223. </tr>
  224. <tr>
  225. <td class = "TasksBody">
  226. <input type="checkbox" class="FormCheckBox" name=chkReadOnly <%=F_strReadOnly%>><%=L_READONLY_TEXT%>
  227. </td>
  228. <td class = "TasksBody">
  229. <input type="checkbox" class="FormCheckBox" name=chkHidden <%=F_strHidden%> ><%=L_HIDDEN_TEXT%>
  230. </td>
  231. </tr>
  232. <tr>
  233. <td class = "TasksBody">
  234. <input type="checkbox" class="FormCheckBox" name="chkArchive" <%=F_strArchive%>><%=L_ARCHIVING_TEXT%>
  235. </td>
  236. </tr>
  237. </table>
  238. <input name="hdnParentFolder" type=Hidden value="<%=Server.HTMLEncode(F_strParentFolderName)%>">
  239. <%
  240. Else
  241. %> <input name="chkReadOnly" type=Hidden value="<%=Server.HTMLEncode(F_strReadOnly)%>">
  242. <input name="chkHidden" type=Hidden value="<%=Server.HTMLEncode(F_strHidden)%>">
  243. <input name="chkArchive" type=Hidden value="<%=Server.HTMLEncode(F_strArchive)%>">
  244. <input name="txtNewFolderName" type="hidden" value="<%=Server.HTMLEncode(F_strFolderName)%>">
  245. <input name="hdnParentFolder" type=Hidden value="<%=Server.HTMLEncode(F_strParentFolderName)%>">
  246. <%
  247. End If
  248. End Function
  249. '-------------------------------------------------------------------------
  250. 'Function name: ServeTabCompress
  251. 'Description: Serves in selecting the tab2
  252. 'Input Variables: PageIn,bIsVisible
  253. 'Output Variables: PageIn
  254. 'Returns: None
  255. 'Global Variables: F_(*),L_(*),gc_ERR_SUCCESS,F_strFolderName
  256. '--------------------------------------------------------------------------
  257. Function ServeTabCompress(ByRef PageIn, ByVal bIsVisible)
  258. If ( bIsVisible ) Then
  259. 'ServeCommonJavaScriptCompress is called for Compress tab initialising,validating and set data
  260. Call ServeCommonJavaScriptCompress()
  261. %>
  262. <table width=100% border="0">
  263. <tr>
  264. <td class = "TasksBody">
  265. <%=L_FOLDER_TEXT %> &nbsp;
  266. <% if instr(F_strParentFolderName,"\")=len(F_strParentFolderName) then
  267. Response.write Server.HTMLEncode(F_strParentFolderName) & Server.HTMLEncode(F_strFolderName)
  268. else
  269. Response.write Server.HTMLEncode(F_strParentFolderName) & chr(92) & Server.HTMLEncode(F_strFolderName)
  270. end if%>
  271. </td>
  272. </tr>
  273. <tr>
  274. <td class = "TasksBody">
  275. <input type="checkbox" class="FormCheckBox" name=chkCompress value="<%=Server.HTMLEncode(F_strCompressed)%>" <%=F_strCompressed%>>&nbsp;<%=L_COMPRESSCONTENTS_TEXT%>
  276. </td>
  277. </tr>
  278. <tr>
  279. <td class = "TasksBody">
  280. <input type="radio" class = "FormRadioButton" name="radFolders" value= "<%=CONST_ARR_APPLYFOLDER%>" Checked>&nbsp;<%=L_APPLYCHANGES_TEXT%>
  281. </td>
  282. </tr>
  283. <tr>
  284. <td class = "TasksBody">
  285. <input type="radio" class = "FormRadioButton" name="radFolders" value= "<%=CONST_ARR_APPLYALLFOLDERS%>" <%=F_strChangeOption%>>&nbsp;<%=L_APPLYCHANGES_EX_TEXT%>
  286. </td>
  287. </tr>
  288. </table>
  289. <%
  290. Else
  291. %>
  292. <input name="chkCompress" type=Hidden value="<%=Server.HTMLEncode(F_strCompressed)%>">
  293. <input name="radFolders" type=Hidden value="<%=Server.HTMLEncode(F_strFolderCompress)%>">
  294. <%
  295. End If
  296. End Function
  297. '-------------------------------------------------------------------------
  298. 'Function name: ServeCommonJavaScriptGeneral
  299. 'Description: Common javascript functions that are required by the General tab
  300. 'Input Variables: None
  301. 'Output Variables: None
  302. 'Returns: None
  303. 'Global Variables: None
  304. '--------------------------------------------------------------------------
  305. Function ServeCommonJavaScriptGeneral()
  306. %>
  307. <script language="JavaScript" SRC="<%=m_VirtualRoot%>inc_global.js">
  308. </script>
  309. <script language="JavaScript">
  310. //Init funtion for General tab
  311. function Init()
  312. {
  313. //Set the focus on folder field
  314. document.frmTask.txtNewFolderName.focus();
  315. // for clearing error message
  316. document.frmTask.onkeypress = ClearErr
  317. return true;
  318. }
  319. //Validate function for General tab
  320. function ValidatePage()
  321. {
  322. var strFoldername
  323. strFoldername = document.frmTask.txtNewFolderName.value;
  324. //Set the readonly checkbox value depending on the status of checkbox
  325. if(document.frmTask.chkReadOnly.checked)
  326. {
  327. document.frmTask.chkReadOnly.value="<%=CONST_CHECKED_TEXT%>";
  328. }
  329. else
  330. {
  331. document.frmTask.chkReadOnly.value="<%=CONST_UNCHECKED_TEXT%>";
  332. }
  333. //Set the hidden checkbox value depending on the status of checkbox
  334. if(document.frmTask.chkHidden.checked)
  335. {
  336. document.frmTask.chkHidden.value="<%=CONST_CHECKED_TEXT%>";
  337. }
  338. else
  339. {
  340. document.frmTask.chkHidden.value="<%=CONST_UNCHECKED_TEXT%>";
  341. }
  342. //Set the archive checkbox value depending on the status of checkbox
  343. if(document.frmTask.chkArchive.checked)
  344. {
  345. document.frmTask.chkArchive.value="<%=CONST_CHECKED_TEXT%>";
  346. }
  347. else
  348. {
  349. document.frmTask.chkArchive.value="<%=CONST_UNCHECKED_TEXT%>";
  350. }
  351. //Blank Foldername Validation
  352. if (Trim(strFoldername) == "")
  353. {
  354. DisplayErr("<%=Server.HTMLEncode(SA_EscapeQuotes(L_ENTERFOLDERNAME_ERRORMESSAGE))%>");
  355. document.frmTask.onkeypress = ClearErr
  356. return false;
  357. }
  358. //Checks for invalid characters in the folder name
  359. if( checkKeyforValidCharacters(strFoldername))
  360. return true;
  361. else
  362. return false;
  363. }
  364. // SetData Function for general tab
  365. function SetData()
  366. {
  367. }
  368. //To check for Invalid Characters
  369. function checkKeyforValidCharacters(strFoldername)
  370. {
  371. var nLength = strFoldername.length;
  372. for(var i=0; i<nLength;i++)
  373. {
  374. charAtPos = strFoldername.charCodeAt(i);
  375. if(charAtPos == 47 || charAtPos == 92 || charAtPos ==58 || charAtPos == 42 || charAtPos == 63 || charAtPos == 34 || charAtPos == 60 || charAtPos == 62 || charAtPos == 124 || charAtPos == 91 || charAtPos == 93 || charAtPos == 59 || charAtPos == 43 || charAtPos == 61 || charAtPos == 44 )
  376. {
  377. DisplayErr("<%=Server.HTMLEncode(SA_EscapeQuotes(L_INVALIDCHARACTERINFOLDERNAME_ERRORMESSAGE))%>");
  378. document.frmTask.onkeypress = ClearErr;
  379. return false;
  380. }
  381. }
  382. return true;
  383. }
  384. </script>
  385. <%
  386. End Function
  387. '-------------------------------------------------------------------------
  388. 'Function name: ServeCommonJavaScriptCompress
  389. 'Description: Common javascript functions that are required by the Compress tab
  390. 'Input Variables: None
  391. 'Output Variables: None
  392. 'Returns: None
  393. 'Global Variables: None
  394. '--------------------------------------------------------------------------
  395. Function ServeCommonJavaScriptCompress()
  396. %>
  397. <script language="JavaScript" src="<%=m_VirtualRoot%>inc_global.js">
  398. </script>
  399. <script language="JavaScript">
  400. //Init function for Compress tab
  401. function Init()
  402. {
  403. return true;
  404. }
  405. //Validate function for Compress tab
  406. function ValidatePage()
  407. {
  408. //Set the Compress checkbox value depending on the status of checkbox
  409. if(document.frmTask.chkCompress.checked)
  410. {
  411. document.frmTask.chkCompress.value="<%=CONST_CHECKED_TEXT%>";
  412. }
  413. else
  414. {
  415. document.frmTask.chkCompress.value="<%=CONST_UNCHECKED_TEXT%>";
  416. }
  417. return true;
  418. }
  419. // SetData Function for Compress tab
  420. function SetData()
  421. {
  422. }
  423. </script>
  424. <%
  425. End Function
  426. '-------------------------------------------------------------------------
  427. 'Function name: CreateNewFolder
  428. 'Description: Creating the new folder and assigning the properties
  429. 'Input Variables: None
  430. 'Output Variables: None
  431. 'Returns: (True / Flase )
  432. 'Global Variables: F_strParentFolderName,F_strFolderName,L_(*)
  433. '--------------------------------------------------------------------------
  434. Function CreateNewFolder
  435. On Error Resume Next
  436. Err.Clear
  437. Dim strFolderPath 'Folder path
  438. Dim objFolder 'File system object
  439. Dim strFolderExists 'To get the folder
  440. Dim objConnection 'Object to get WMI connection
  441. Dim objFolderProp 'To get the folders properties
  442. Dim objDirInstances 'Collection to get Instances of Win32_Directory class
  443. Dim objDirInstance 'Object to get Instance of Win32_Directory class
  444. Dim strQuery
  445. Const CONST_N_DEVICENOTREADY_ERRNO = 71 'Error number incase derive is not ready
  446. Const CONST_N_FOLDER_READ_ATTRIBUTE = 1 'Constant for folder read attribute
  447. Const CONST_N_FOLDER_HIDDEN_ATTRIBUTE = 2 'Constant for folder hidden attribute
  448. Const CONST_N_FOLDER_ARCHIVE_ATTRIBUTE = 32 'Constant for folder archive attribute
  449. Call SA_TraceOut(SOURCE_FILE, "CreateNewFolder")
  450. CreateNewFolder= FALSE
  451. 'Folder path
  452. If right(F_strParentFolderName,1) = chr(92) then
  453. 'If parent folder path is already having "\" donot append the "\"
  454. strFolderPath= F_strParentFolderName & F_strFolderName
  455. Else
  456. 'If parent folder path donot have "\" append the "\"
  457. strFolderPath= F_strParentFolderName & chr(92) & F_strFolderName
  458. End If
  459. 'Create File System Object
  460. Set objFolder = createobject("scripting.FileSystemObject")
  461. If Err.number <> 0 Then
  462. Call SA_SetErrMsg (L_FILESYSTEMOBJECTNOTCREATED_ERRORMESSAGE & "(" & Hex(Err.Number) & ")" )
  463. Exit Function
  464. End If
  465. 'Checking if the folder already exists
  466. If Not objFolder.FolderExists(strFolderPath) Then
  467. CreateNewFolder = TRUE
  468. 'Creating the new folder
  469. objFolder.CreateFolder(strFolderPath)
  470. If Err.Number <> 0 Then
  471. If Err.number= CONST_N_DEVICENOTREADY_ERRNO Then
  472. Call SA_SetErrMsg (L_DEVICEISNOTREADY_ERRORMESSAGE & "(" & Err.Number & ")" )
  473. CreateNewFolder = FALSE
  474. Exit Function
  475. Else
  476. Call SA_SetErrMsg (L_DIRECTORYNOTCREATED_ERRORMESSAGE & "(" & Err.Number & ")" )
  477. CreateNewFolder = FALSE
  478. Exit Function
  479. End If
  480. End If
  481. 'Get the specified folder
  482. Set objFolderProp = objFolder.GetFolder(strFolderPath)
  483. 'Set the Read Only attributes
  484. If trim(F_strReadOnly)= trim(CONST_CHECKED_TEXT) Then
  485. objFolderProp.attributes =objFolderProp.attributes + CONST_N_FOLDER_READ_ATTRIBUTE
  486. End If
  487. 'Set the Hidden attribute
  488. If trim(F_strHidden)= trim(CONST_CHECKED_TEXT) Then
  489. objFolderProp.attributes =objFolderProp.attributes + CONST_N_FOLDER_HIDDEN_ATTRIBUTE
  490. End If
  491. 'Set the Archives attribute
  492. If trim(F_strArchive)= trim(CONST_CHECKED_TEXT) Then
  493. objFolderProp.attributes = objFolderProp.attributes + CONST_N_FOLDER_ARCHIVE_ATTRIBUTE
  494. End If
  495. 'Create connection to WMI
  496. Set objConnection = GetWMIConnection(CONST_WMI_WIN32_NAMESPACE)
  497. 'Create instance of Win32_Directory
  498. strQuery = "Select * from Win32_Directory where Name = " & chr(34) & replace(strFolderPath, "\", "\\") & chr(34)
  499. Set objDirInstances = objConnection.ExecQuery(strQuery)
  500. 'Failed to connect to WMI
  501. If Err.Number <> 0 Then
  502. Call SA_ServeFailurepage (L_WMICONNECTIONFAILED_ERRORMESSAGE & " " & Hex(Err.Number))
  503. CreateNewFolder = FALSE
  504. Exit Function
  505. End if
  506. For each objDirInstance in objDirInstances
  507. 'Set the compress property of folder
  508. If UCase(F_strCompressed) = trim(Ucase(CONST_CHECKED_TEXT)) then
  509. if F_strFolderCompress = CONST_ARR_APPLYFOLDER then
  510. objDirInstance.UnCompressEX null,null,True
  511. objDirInstance.CompressEX null,null,False
  512. elseif F_strFolderCompress = CONST_ARR_APPLYALLFOLDERS then
  513. objDirInstance.UnCompressEX null,null,False
  514. objDirInstance.CompressEX null,null,True
  515. end if
  516. End if
  517. Exit for
  518. Next
  519. Set objDirInstance= Nothing
  520. Set objConnection = Nothing
  521. Else
  522. Call SA_SetErrMsg (L_DIRECTORYALREADYEXISTS_ERRORMESSAGE & "(" & Hex(Err.Number) & ")" )
  523. Exit Function
  524. End If
  525. 'Release the objects
  526. Set objFolderProp = Nothing
  527. Set objFolder = Nothing
  528. End Function
  529. %>