Programma op server starten via webpage

Pagina: 1
Acties:

  • mitch2kbe
  • Registratie: Januari 2008
  • Laatst online: 21-08 11:46
Hey,

Ik weet niet echt of dit in het juiste subforum is geplaatst..

Ik zou graag via een knop op een webpagina een programma starten op een windows 2003 server.

Op die server staat een programma dat zorgt voor de synchronisatie van enkele bestanden. Is gewoon een exe of bat die je start, lokaal op de server.
Ik zou dus dat bestand willen starten van om het even waar door een simpele webpagina met een knop.
Dus als je op die knop klikt van om het even waar, dat het is alsof je met remote desktop bent ingelogd op de server, en zo het bestand uitvoert..

Iemand een idee hoe dit ik kan doen?

  • krvabo
  • Registratie: Januari 2003
  • Laatst online: 12-11 22:03

krvabo

MATERIALISE!

Pong is probably the best designed shooter in the world.
It's the only one that is made so that if you camp, you die.


  • mitch2kbe
  • Registratie: Januari 2008
  • Laatst online: 21-08 11:46
Hmzz, helpt me al wat verder. Thanks!

Echter krijg ik het nog niet helemaal aan de praat..
Kan je met het exec command rechtstreeks een pad opgeven?

Dit lijkt alvast niet te werken:

<?php
echo exec('"C:\Program Files\2BrightSparks\SyncBackSE\SyncBackSE.exe" -m "test"');
?>

  • krvabo
  • Registratie: Januari 2003
  • Laatst online: 12-11 22:03

krvabo

MATERIALISE!

Probeer dit eens?
PHP:
1
2
3
<?php
echo exec("\"C:\\Program Files\\2BrightSparks\\SyncBackSE\\SyncBackSE.exe\" -m \"test\" ");
?>

(escapen)

[edit]
Hm zo te zien werkte je eerst met single quotes om niet te hoeven escapen, wat eigenlijk beter is.
Krijg je met jouw oplossing nog een error?

Je kan opzich ook
PHP:
1
2
<?php
`"C:\Program Files\2BrightSparks\SyncBackSE\SyncBackSE.exe" -m "test"`;

(backtics)
Als je een error krijgt dan uiteraard hier even neerzetten :P

[ Voor 53% gewijzigd door krvabo op 16-06-2008 01:17 ]

Pong is probably the best designed shooter in the world.
It's the only one that is made so that if you camp, you die.


  • mitch2kbe
  • Registratie: Januari 2008
  • Laatst online: 21-08 11:46
Alvast bedankt voor je hulp!

Voer ik dit uit, krijg ik direct een blanke pagina, en gebeurd er niets:

<?php
echo exec("\"C:\\Program Files\\2BrightSparks\\SyncBackSE\\SyncBackSE.exe\" -m \"test\" ");
?>


Voer ik dit uit, dan start het Syncback.exe wel mooi (te zien in task manager). De webpagina blijft wel gewoon laden:

<?php
echo exec("\"C:\\Program Files\\2BrightSparks\\SyncBackSE\\SyncBackSE.exe\" ");
?>

Dus het starten lukt wel, maar niet met de bijkomende argumenten -m \"test\" om syncback aan te geven welk profiel hij wilt runnen.
Nog een bijkomende vraag; Syncback wordt nu uitgevoerd als system, zodat je dus ook geen GUI te zien krijgt. Is dit eventueel ook mogelijk om als Administrator te runnen, met GUI?

Thx!

  • djc
  • Registratie: December 2001
  • Laatst online: 08-09 23:18

djc

mitch2kbe schreef op maandag 16 juni 2008 @ 07:40:
Nog een bijkomende vraag; Syncback wordt nu uitgevoerd als system, zodat je dus ook geen GUI te zien krijgt. Is dit eventueel ook mogelijk om als Administrator te runnen, met GUI?
Ik denk het niet. Als je een proces opstart vanuit PHP zal het in principe altijd gestart worden als subproces van het PHP-proces. Dat heeft geen GUI, dus je kan ook niet echt een GUI opstarten (denk ik).

Rustacean


  • burrug
  • Registratie: April 2005
  • Laatst online: 14-10-2024
Ik zou een batch bestand maken met argumenten en die dan runnen..

[ Voor 31% gewijzigd door burrug op 16-06-2008 08:16 ]

Tannoy Revolution R3 105W 6ohm, Marantz PM-7003 2x70W 8ohm, 2x JVG goud/goud, Marantz CD-6003, Marantz ST-6003


  • Stamgastje
  • Registratie: April 2003
  • Laatst online: 02-02-2020
Dat moet wel lukken via een omweg. Nadeel is wel dat je username en pwd in je PHP script moeten staan, dus uitkijken dat dat nooit letterlijk het web op kan gaan.

  • krvabo
  • Registratie: Januari 2003
  • Laatst online: 12-11 22:03

krvabo

MATERIALISE!

Mwa als het program een GUI heeft, dan wordt gewoon de GUI gestart. Normaliter iig :P

Ik weet niet of het helpt bij je probleem, maar kijk nog even naar: http://www.chipmunkninja....Execution-in-PHP:-exec-m@

Pong is probably the best designed shooter in the world.
It's the only one that is made so that if you camp, you die.


  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
Ik zie in de verste verte niet wat dit met SEA van doen heeft :?
Waar hoort mijn topic?

SEA >> PRG

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


Verwijderd

PsTools
Copyright © 1999-2005 Mark Russinovich
Sysinternals - www.sysinternals.com


The Windows NT and Windows 2000 Resource Kits come with a number of command line tools that help you administer your Windows NT/2K systems. Over time, I've grown a collection of similar tools, including some not included in the Resource Kits. What sets these tools apart is that they all allow you to manage remote systems as well as the local one. The first tool in the suite was PsList, a tool that lets you view detailed information about processes, and the suite is continually growing. The "Ps" prefix in PsList relates to the fact that the standard UNIX process listing command-line tool is named "ps", so I've adopted this prefix for all the tools in order to tie them together into a suite of tools named PsTools.

All of the utilities in the PsTools suite work on Windows NT, Windows 2000, Windows XP, and Server 2003 and none of the tools requires any special installation. You don't even need to install any client software on the remote computers at which you target them. Run them by typing their name and any command-line options you want. To show complete usage information, specify the "-?" command-line option.

The tools included in the PsTools suite are:

PsExec - execute processes remotely

PsFile - shows files opened remotely

PsGetSid - display the SID of a computer or a user

PsInfo - list information about a system

PsKill - kill processes by name or process ID

PsList - list detailed information about processes

PsLoggedOn - see who's logged on locally and via resource sharing

PsLogList - dump event log records
PsPasswd - changes account passwords

PsService - view and control services

PsShutdown - shuts down and optionally reboots a computer

PsSuspend - suspend and resume processes


Requirements
Some of the tools require that the default admin$ share be available and/or that the Remote Registry service be active.


License
No part of PsTools may be redistributed in any way, or by any means, without the prior written permission of Sysinternals LLC. If you wish to redistribute

PsTools, for example for use within an organization, please contact licensing@sysinternals.com.

  • remco_k
  • Registratie: April 2002
  • Laatst online: 23:10

remco_k

een cassettebandje was genoeg

mitch2kbe schreef op maandag 16 juni 2008 @ 07:40:...
Syncback wordt nu uitgevoerd als system, zodat je dus ook geen GUI te zien krijgt. Is dit eventueel ook mogelijk om als Administrator te runnen, met GUI?
Start services.msc, zoek de service op die dienst doet als webservice (PHP, Apache?), eigenschappen tabblad 'aanmelden'. Aanmelden als: lokale systeem account, vinkje voor 'System kan interactief met bureaublad worden uitgevoerd'.
Service even opnieuw starten en uitproberen of het doet wat je wilt.

Is een oplossing denk ik, of hij netjes, veilig en slim is om te doen, geen idee. :+

[ Voor 7% gewijzigd door remco_k op 16-06-2008 13:42 ]

Alles kan stuk.

Pagina: 1