Need help,
I have power shell script and want to running in vfp 9.0, here is content of power shell file
Content of disableprint.ps1:
$username = 'test'
$password = 'test123'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
Invoke-Command -FilePath D:\data\datanya\disableprint0.ps1 -Credential $cred -ComputerName $env:computername
Here is disableprint0.ps1 content:
net start "Print Spooler"
Content of testps2.bat
powershell -command .\disableprint.ps1
How to handle it in vfp 9.0 since I used bat file and type in vfp command not running
I tried as below
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
INTEGER nWinHandle, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParameters, ;
STRING cDirectory, ;
INTEGER nShowWindow
cAction = "Open"
cFileName = "d:\data\datanya\testps2.bat"
ShellExecute( 0, cAction, cFileName, "", "", 2 )
Please help how to handle those command?
Thank you
I have power shell script and want to running in vfp 9.0, here is content of power shell file
Content of disableprint.ps1:
$username = 'test'
$password = 'test123'
$cred = New-Object System.Management.Automation.PSCredential -ArgumentList @($username,(ConvertTo-SecureString -String $password -AsPlainText -Force))
Invoke-Command -FilePath D:\data\datanya\disableprint0.ps1 -Credential $cred -ComputerName $env:computername
Here is disableprint0.ps1 content:
net start "Print Spooler"
Content of testps2.bat
powershell -command .\disableprint.ps1
How to handle it in vfp 9.0 since I used bat file and type in vfp command not running
I tried as below
DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
INTEGER nWinHandle, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParameters, ;
STRING cDirectory, ;
INTEGER nShowWindow
cAction = "Open"
cFileName = "d:\data\datanya\testps2.bat"
ShellExecute( 0, cAction, cFileName, "", "", 2 )
Please help how to handle those command?
Thank you