Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Reg file enters incorrect entries, but only from Foxpro
Message
From
31/10/2007 09:04:11
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
30/10/2007 23:45:40
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
Miscellaneous
Thread ID:
01265070
Message ID:
01265325
Views:
13
>>If I run a batch file directly it enters the correct entries, but if I run it from within Foxpro, it does not. The values of BackupDirectory, DataDirectory and PromptDirectory are different, and they are different in the resulting REG file. If I run the BAT or REG file outside of Foxpro, they work great. If I run from inside Foxpro (like I am below with the RUN command, then all three get the value assigned to the BackupDirectory in the registry. What could be causing this? Thanks!
>>
>>
>>
>>* Do NOT indent (or use Beautify on) these TEXT/ENDTEXT blocks as it will mess up the results
>>TEXT to m.RegCommands TEXTMERGE NOSHOW
>>REGEDIT4
>><<m.InstallHKey>>
>>"AppDirectory"="<<m.InstallAppDirectory>>"
>>"Application"="<<m.InstallApplication>>"
>>"HostName"="<<m.DefaultHostName>>"
>>"Port"="<<m.DefaultPort>>"
>>"BackupDirectory"="<<m.DefaultBackupDirectory>>"
>>"DataDirectory"="<<m.DefaultDataDirectory>>"
>>"PromptDirectory"="<<m.DefaultPromptDirectory>>"
>>"Switch"="<<m.DefaultSwitch>>"
>>ENDTEXT
>>
>>	* Create the REG file
>>	m.RegFilename = '"' + JUSTPATH(application.servername) + [\EMPS.REG] + '"'
>>	STRTOFILE(m.RegCommands,m.RegFilename)
>>
>>	* Initialize the variable that will hold the BAT file commands
>>	m.InstallBatchCommands = ''
>>
>>* Do NOT indent (or use Beautify on) these TEXT/ENDTEXT blocks as it will mess up the results
>>TEXT to m.InstallBatchCommands TEXTMERGE NOSHOW
>>NET STOP EMPS
>>SC delete "EMPS"
>><<m.instsrvFilename>> "EMPS" <<m.srvanyFilename>>
>>REGEDIT.EXE /S <<m.RegFilename>>
>>ENDTEXT
>>
>>	* Create the BAT file
>>	m.InstallBatchFilename = '"' + JUSTPATH(application.servername) + '\EMPS_Install.bat' + '"'
>>	STRTOFILE(m.InstallBatchCommands,m.InstallBatchFilename)
>>
>>	* Run the BAT file
>>	RUN /N &InstallBatchFilename
>>
>>	* Give the batch file time to run
>>	m.TimePause = DATETIME() + 3
>>	DO WHILE DATETIME() < m.TimePause && Wait 3 seconds...
>>	ENDDO
>>
>
>Just a SWAG - could you try name resolution instead of macro substitution?
>
>RUN /N ( m.InstallBatchFilename )
>
I found that using SLEEP 5 in the batch file just before running the REG file worked fine. I think that the instsrv and srvany process were taking some time. Don't know why that would be the case, but the SLEEP worked. If you have any ideas why, I would love to hear them.
Previous
Reply
Map
View

Click here to load this message in the networking platform