Home > Software engineering > How to determine the INI file exists, does not exist, how to generate this file
How to determine the INI file exists, does not exist, how to generate this file
Time:10-11
How to determine the INI file exists, does not exist, how to generate this file
CodePudding user response:
If Len (Dir (" ini files. Ini "))=0 Then Open "ini files. Ini" For the Output As the # 1 Print # 1, "... " Print # 1, "... " Print # 1, "... " Close # 1 End the If
CodePudding user response:
Dim fs, f Set the fs=CreateObject (" Scripting. FileSystemObject ") If Not the fs. FileExists (" C: \ test. Ini ") Then The Set f=fs. CreateTextFile (" C: \ test. Ini ", True) F.w riteline (" INI file content ") F. lose The Set f=Nothing End the If Set the fs=Nothing