Topic "Passing arguments from PHP"

Author Message
moduor

Guest


I am using php to execute cmd which executes my batch file. Is there a way to pass my php variables to the batch file? Below is my php code which is working well:
Code:
exec('c:\WINDOWS\system32\cmd.exe /c START C:\inetpub\.....\sync.bat');
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
what does this have to do with WinSCP?
moduor
[View user's profile]

Joined: 2016-08-04
Posts: 1
Location: Nairobi
Because I am using windows cmd to execute WinSCP batch file
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
But that still does not make this WinSCP question.

But anyway, you pass variables to the argument as with any other string in PHP:

exec("c:\WINDOWS\system32\cmd.exe /c START C:\inetpub\.....\sync.bat $variable1 $variable2");
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License