Hi, has anyone else ran into this problem using Procomm scripts on Windows 7? I have a script that runs a batch file to get the username of the pc, to do this I run the below script, I have a while taskexists yield so the script will wait until the batch file complets before moving on. This works really well in XP, but when I switched to Windows 7 it takes a long time (about a minute or longer) for the script to continue. Long after the batch file has completed.
Thanks,
PROC GET_USER_NAME
STRING GETPCUSERNAMEBAT="Y:\PM\OSS\Aspect\PCUSERNAMEBAT.BAT"
IF NOT FOPEN 1 GETPCUSERNAMEBAT CREATE TEXT
ERRORMSG "UNABLE TO OPEN OR CREATE %s" GETPCUSERNAMEBAT
ENDIF
FPUTS 1 "C:"
FPUTS 1 "CD\"
FPUTS 1 "SET > C:\PERSONAL\PCUSERNAME.TXT"
FFLUSH 1
FCLOSE 1
RUN GETPCUSERNAMEBAT HIDDEN PCUSER
WHILE TASKEXISTS PCUSER
YIELD
ENDWHILE
FOPEN 0 PCUSERNAME_TXT READ TEXT
WHILE NOT FEOF 0
FGETS 0 PCUSERNAMELINE
IF STRFIND PCUSERNAMELINE "USERNAME="
STREXTRACT PCUSERNAME PCUSERNAMELINE "=" 1
ENDIF
ENDWHILE
FCLOSE 0
DELFILE "C:\PERSONAL\PCUSERNAME.TXT"
;USERMSG "*%s*" PCUSERNAME
ENDPROC
Thanks,
PROC GET_USER_NAME
STRING GETPCUSERNAMEBAT="Y:\PM\OSS\Aspect\PCUSERNAMEBAT.BAT"
IF NOT FOPEN 1 GETPCUSERNAMEBAT CREATE TEXT
ERRORMSG "UNABLE TO OPEN OR CREATE %s" GETPCUSERNAMEBAT
ENDIF
FPUTS 1 "C:"
FPUTS 1 "CD\"
FPUTS 1 "SET > C:\PERSONAL\PCUSERNAME.TXT"
FFLUSH 1
FCLOSE 1
RUN GETPCUSERNAMEBAT HIDDEN PCUSER
WHILE TASKEXISTS PCUSER
YIELD
ENDWHILE
FOPEN 0 PCUSERNAME_TXT READ TEXT
WHILE NOT FEOF 0
FGETS 0 PCUSERNAMELINE
IF STRFIND PCUSERNAMELINE "USERNAME="
STREXTRACT PCUSERNAME PCUSERNAMELINE "=" 1
ENDIF
ENDWHILE
FCLOSE 0
DELFILE "C:\PERSONAL\PCUSERNAME.TXT"
;USERMSG "*%s*" PCUSERNAME
ENDPROC