CMS Software
07-09-2014, 02:33 PM
We never know whether our users are running 32 or 64 versions of XP, Win 7 or Win 8.1. In the old XP versions, there was no "ProgramData" folder but in the later Windows versions there is. We found that attempting to "create" a folder that already exists does not generate an error. We use the following code which will create the folder if it is not there and which will generate no error if it is there.
=====
If %_SB_ROOT%\PROGRAMDATA File or Folder doesn't exist Then
::Create Folder "%_SB_ROOT%\ProgramData" (Always Install)
If %_SB_ERRORCODE% Equals "0" Then
Display Message Box "The creation of C:\ProgramData FAILED!" -- "Create Folder ProgramData"
End
End
Set File Attributes for "%_SB_ROOT%\PROGRAMDATA"
=====
On some machines running Windows 7 Professional 64 bit, it fails every time. Other users have no errors. We also create other folders under PROGRAMDATA and if the "%_SB_ROOT%\PROGRAMDATA" creation fails, then obviously all the sub folders fail also.
As a side question, on all Windows computers isn't %_SB_ROOT% always the "C:" drive?
Thanks
-O. D.-
=====
If %_SB_ROOT%\PROGRAMDATA File or Folder doesn't exist Then
::Create Folder "%_SB_ROOT%\ProgramData" (Always Install)
If %_SB_ERRORCODE% Equals "0" Then
Display Message Box "The creation of C:\ProgramData FAILED!" -- "Create Folder ProgramData"
End
End
Set File Attributes for "%_SB_ROOT%\PROGRAMDATA"
=====
On some machines running Windows 7 Professional 64 bit, it fails every time. Other users have no errors. We also create other folders under PROGRAMDATA and if the "%_SB_ROOT%\PROGRAMDATA" creation fails, then obviously all the sub folders fail also.
As a side question, on all Windows computers isn't %_SB_ROOT% always the "C:" drive?
Thanks
-O. D.-