7 Replies - 2214 Views - Last Post: 10 February 2009 - 04:32 AM Rate Topic: -----

#1 redfla9   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 05-February 09

how to check permission on files in windows

Post icon  Posted 08 February 2009 - 04:59 PM

Hi
i'm trying to open a program on a server over the intenet. i'm currently trying to using php with the "systems()" command see the post: http://www.dreaminco...showtopic=84977 since this didn't work i would like to know how to check the permission of my program, i'm currenlty using XAMPP with apache mysql and windows. As i think the reason it's not working could be due to permissions being incorrect. i have looked on google but only found information concerning unix.

Is This A Good Question/Topic? 0
  • +

Replies To: how to check permission on files in windows

#2 bsaunders   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: how to check permission on files in windows

Posted 08 February 2009 - 08:28 PM

Can you post your code with the call to system()?
Was This Post Helpful? 0
  • +
  • -

#3 Auzzie   User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: how to check permission on files in windows

Posted 09 February 2009 - 02:54 AM

as bsaunders stated you do realize that it is system() not systems()
Was This Post Helpful? 0
  • +
  • -

#4 redfla9   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 05-February 09

Re: how to check permission on files in windows

Posted 09 February 2009 - 04:08 PM

$cmd="C:\Documents and Settings\Brad\Microsoft Robotics Dev Studio 2008\bin\DssHost.exe";
$arg1="-port:50000";
$arg2="-tcpport:50001";
$arg3="-manifest\"C:\Documents and Settings\Brad\Microsoft Robotics Dev Studio 2008\samples\Config\MobileRobots.P3DX.Simulation.manifest.xml\"";

system("$cmd $arg1 $arg2 $arg3", $retval);
Was This Post Helpful? 0
  • +
  • -

#5 Auzzie   User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: how to check permission on files in windows

Posted 09 February 2009 - 06:53 PM

first off use the code tags for your code
[/code] and when using double quotes you need to realize that \ is an escape character so change to this

[code]
$cmd="C:\\Documents and Settings\\Brad\\Microsoft Robotics Dev Studio 2008\\bin\\DssHost.exe";
$arg1="-port:50000";
$arg2="-tcpport:50001";
$arg3="-manifest\"C:\\Documents and Settings\\Brad\\Microsoft Robotics Dev Studio 2008\\samples\\Config\\MobileRobots.P3DX.Simulation.manifest.xml\"";

system("$cmd $arg1 $arg2 $arg3", $retval); 


I am not saying that the code will work but it solves one problem at least
Was This Post Helpful? 0
  • +
  • -

#6 bsaunders   User is offline

  • D.I.C Addict

Reputation: 44
  • View blog
  • Posts: 571
  • Joined: 18-January 09

Re: how to check permission on files in windows

Posted 09 February 2009 - 07:46 PM

Does this work?:

$cmd="C:\\Documents and Settings\\Brad\\Microsoft Robotics Dev Studio 2008\\bin\\DssHost.exe";
$arg1="/p:50000";
$arg2="/t:50001";
$arg3="/m:\"C:\\Documents and Settings\\Brad\\Microsoft Robotics Dev Studio 2008\\samples\\Config\\MobileRobots.P3DX.Simulation.manifest.xml\"";

system("$cmd $arg1 $arg2 $arg3", $retval);


What was the return value of system()?
Was This Post Helpful? 0
  • +
  • -

#7 redfla9   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 13
  • Joined: 05-February 09

Re: how to check permission on files in windows

Posted 09 February 2009 - 09:36 PM

hi
thanks for the replies.
i have tryed both code blocks both resulted in retval being 1 which i'm pretty sure is a fail
also the program didn't start, as i said at the start i'm thinking the problem is most likely with the permission that a remote user has when accessing the file.

my batch file which can also run the program is as follows

cd C:\Documents and Settings\Brad\Microsoft Robotics Dev Studio 2008\
bin\dsshost -port:50000 -tcpport:50001 -manifest:"C:\Documents and Settings\Brad\Microsoft Robotics Dev Studio 2008\samples\Config\MobileRobots.P3DX.Simulation.manifest.xml"

but even when i call this batch file using the following line in a webpage

exec("RunSimulation1.0.4.bat", $retval);

i can see the the program starts to run in the task mannager, but then it locks up and does not completely load the program, the webpage an IE stops working, till i mannually close down the process in task mannager.

This post has been edited by redfla9: 09 February 2009 - 09:47 PM

Was This Post Helpful? 0
  • +
  • -

#8 Auzzie   User is offline

  • D.I.C Addict
  • member icon

Reputation: 43
  • View blog
  • Posts: 573
  • Joined: 20-January 09

Re: how to check permission on files in windows

Posted 10 February 2009 - 04:32 AM

try having a look at exec see if that gives you a hand for the exact problem, if that doesn't work, maybe have a look at PHP-GTK, which is the desktop version of PHP, you can call a simple PHP-GTK program through a normal PHP web file and then the GTK file can do what you are after
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1