I have a new customer running Vista Home on a Dell laptop. My program is refusing to run and fails at the same point. The relevant code snippet is below:-
This code runs perfectly well on XP machines and on my Vista laptop, and I cannot see what the problem is. Any ideas???
Iain Johnstone
Code:
GetUserName szStr, SIZEOF(szStr) temp=szstr ProfilePath="C:\Documents and Settings\"+temp+"\Application Data\Mstdrain\" IF DIR$ (ProfilePath)="" THEN 'new user DIALOG NEW gmain, "New user - setting up your copy.", 12, 115, 100, 0, TO hDlg2 DIALOG SHOW MODELESS hDlg2 MKDIR ProfilePath Filepath=ProfilePath+"MSTDRAIN.INI" ?"getting profile for "+filepath 'displays correct file path and name 'OK to here '**************************************************** OPEN filepath FOR BINARY AS #1 filesize=LOF(1) CLOSE #1 'fails around here as msgboxes are never displayed 'gets Vista failure notice instead '**************************************************** IF filesize=0 THEN 'create user ini ?"creating user ini" filenumber=FREEFILE ATTRIB filepath,0 OPEN filepath FOR OUTPUT AS #1 WRITE #1,"~" .................etc CLOSE #1 ELSE ?"already exists ................etc END IF
Iain Johnstone
Comment