Workaround with paths in vista
Posted
by Argiropoulos Stavros
on Super User
See other posts from Super User
or by Argiropoulos Stavros
Published on 2010-01-17T07:52:32Z
Indexed on
2010/04/19
18:04 UTC
Read the original article
Hit count: 403
Not really a programming question but i think quite relative. I have a .exe running in my windows XP PC. This exe needs a file in the same directory to run and has no problem finding it in XP BUT in Vista(I tried this in several machines and works in some of them) fails to run. I'm guessing there is a problem finding the path.The program is written in basic(Yes i know..) I attach the code below. Can you think of any workarounds? Thank you
The exe is located in c:\tools Also the program runs in windows console(It starts but then during the execution cannot find a custom file type .TOP made by the creator of the program)
' PROGRAMM TOP11.BAS
DEFDBL A-Z
CLS
LOCATE 1, 1
COLOR 14, 1
FOR i = 1 TO 80
PRINT "±";
NEXT i
LOCATE 1, 35: PRINT "?? TOP11 ??"
PRINT " €€‚—‚„‘ ’— ‹„’†‘„— ‘’† „”€„€ ’†‘ ‡€€‘‘†‘ ‰€ † „.‚.‘.€. "
COLOR 7, 0
PRINT "-------------------------------------------------------------------------------"
PRINT
INPUT "ƒ?©« «¦¤ ©¬¤«?©«? ¤???... : ", Factor#
INPUT "¤¦£ ¨®e¦¬ [.TOP] : ", topfile$
VIEW PRINT 7 TO 25
file1$ = topfile$ + ".TOP"
file2$ = topfile$ + ".T_P"
file3$ = "Syntel"
OPEN file3$ FOR OUTPUT AS #3
PRINT #3, " ‘¬¤«?©«?? ¤??? = " + STR$(Factor#) + " †‹„‹†€: " + DATE$
CLOSE #3
command1$ = "copy" + " " + file1$ + " " + file2$
SHELL command1$ '’¦ ¨®e¦ .TOP ¤« ¨a« £ «¤ ?«a?¥ .T_P
OPEN file2$ FOR INPUT AS #1
OPEN file1$ FOR OUTPUT AS #2
bb$ = " \\\ \ , ###.#### ###.#### ####.### ##.### "
DO
LINE INPUT #1, Line$
Line$ = RTRIM$(LTRIM$(Line$))
icode$ = LEFT$(Line$, 1)
IF icode$ = "1" THEN
Line$ = " " + Line$
PRINT #2, Line$
PRINT Line$
ELSEIF icode$ = "2" THEN
Line$ = " " + Line$
PRINT #2, Line$
PRINT Line$
ELSEIF icode$ = "3" THEN
Number$ = MID$(Line$, 3, 6)
Hangle = VAL(MID$(Line$, 14, 9))
Zangle = VAL(MID$(Line$, 25, 9))
Distance = VAL(MID$(Line$, 36, 9))
Distance = Distance * Factor#
Height = VAL(MID$(Line$, 48, 6))
PRINT #2, USING bb$; icode$; Number$; Hangle; Zangle; Distance; Height
PRINT USING bb$; icode$; Number$; Hangle; Zangle; Distance; Height
ELSE
END IF
LOOP UNTIL EOF(1)
VIEW PRINT
CLS
LOCATE 1, 1
PRINT " *** ’„‘ ’“ ‚€‹‹€’‘ *** "
END
© Super User or respective owner