local mawdrive,mawdirectory,mawpath,mcopysubmit,mawdirtochange mawdrive = "" mawdirectory = "" mawpath = "" mfiletorun = "" mawdirtochange = "" use programlocation && Table contains information about file and directory locations go top mawdrive = programlocation.anywaredrv mawdirectory = programlocation.anywaredrc mawpath = alltrim(mawdrive)+":\"+alltrim(mawdirectory)+"\MCIBTELE.BAT type sdf" mfiletorun = alltrim(mawdrive)+":\"+alltrim(mawdirectory)+"\MCIBTELE.BAT" mawdirtochange = "cd \"+alltrim(mawdirectory) use use PCanywhere exclusive zap go top append blank replace connectaw with "@echo off" append blank replace connectaw with "cd\" append blank replace connectaw with mawdirtochange append blank replace connectaw with 'awremote -M=D -N="MCIB"' go top copy to &mawpath use run &mfiletorunAnd &mFileToRun whould be something like:
c:\AW\MCIBTELE.BATProblem: When the command button is clicked for the first time, the code works and pcAnywhere as supplied by the paying agency is invoked. When the command button is clicked again, all I see is the flash of probably a DOS window and nothing beyond that - in that pcAnywhere is not invoked. Merely shutting down VFP and restarting the applications does not appear to reset the environment. Shutting down the machine completely and rebooting allows me to fire that command button once only.