This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: WriteLine to Server Share
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 20, 2011
03:00 PM
WriteLine to Server Share
Hi, I have this code:
function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType, nvFileHandle;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szName, szCompany, szTargetPath, szDir, szFeatures, szLine, szString, CPU;
BOOL bLicenseAccepted;
begin
OpenFileMode (FILE_MODE_APPEND);
CreateFile (nvFileHandle, "\\\\Server01\\Logs$\\test", "CreateFileISM.txt");
// this works. The file called CreateFileISM.txt does get created on the server.
CPU=(LaunchApplication("C:\\Windows\\System32\\cmd.exe", "/c wmic cpu get Manufacturer", "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE));
WriteLine(nvFileHandle,"\\\\Server01\\Logs$\\test\\CreateFileISM.txt", CPU);
end;
// The WriteLine fails and I have not gotten it to work yet. Where is my syntax in error?
Thanks.
function OnFirstUIBefore()
number nResult, nLevel, nSize, nSetupType, nvFileHandle;
string szTitle, szMsg, szOpt1, szOpt2, szLicenseFile;
string szName, szCompany, szTargetPath, szDir, szFeatures, szLine, szString, CPU;
BOOL bLicenseAccepted;
begin
OpenFileMode (FILE_MODE_APPEND);
CreateFile (nvFileHandle, "\\\\Server01\\Logs$\\test", "CreateFileISM.txt");
// this works. The file called CreateFileISM.txt does get created on the server.
CPU=(LaunchApplication("C:\\Windows\\System32\\cmd.exe", "/c wmic cpu get Manufacturer", "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE));
WriteLine(nvFileHandle,"\\\\Server01\\Logs$\\test\\CreateFileISM.txt", CPU);
end;
// The WriteLine fails and I have not gotten it to work yet. Where is my syntax in error?
Thanks.
(1) Reply
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jun 21, 2011
09:48 AM
Hi,
It is enough to call LaunchApplication:
//=============================================
LaunchApplication("C:\\Windows\\System32\\cmd.exe", "/c wmic cpu get Manufacturer >\"\\\\Server01\\Logs$\\test\\cpu.txt\"", "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE);
//=============================================
cpi.txt gets the Manufacturer.
It is enough to call LaunchApplication:
//=============================================
LaunchApplication("C:\\Windows\\System32\\cmd.exe", "/c wmic cpu get Manufacturer >\"\\\\Server01\\Logs$\\test\\cpu.txt\"", "", SW_HIDE, INFINITE, LAAW_OPTION_USE_SHELLEXECUTE);
//=============================================
cpi.txt gets the Manufacturer.