Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulating REXX 1

Status
Not open for further replies.

YoungManRiver

IS-IT--Management
Feb 9, 2004
220
US
I have a REXX procedure that does the following:
[ul]
[li]Map all local windows drives,[/li]
[li]Delete "somefile.txt",[/li]
[li]Run equiv to "dir *.* /s /b >> somefile.txt" for each drive,[/li]
[li]Read and filter "somefile.txt" to eliminate program and OS files,[/li]
[li]Load the File Results into "f_results.txt",[/li]
[li]Load the Dir Results into "d_results.txt",[/li]
[/ul]
I want to be able to dup this whole procedure in PHP, but can not find anything to:
[ul]
[li]Map the local windows drives,[/li]
[li]Read all the files including subdirs.[/li]
[/ul]
I've read everything I can find about mapping the drives for PHP and still know nothing. Also all the PHP scandir and simular commands just do not handle subdirectories right, so I loose files.

Does anyone have code that does these functions?

YMR
 
PHP runs on the server, so all these operations would be done on the server and not the client. You can't use PHP to map drives on the client machine. You wold need to execute some kind of local script for that which would defeat the purpose.

It sounds like you want to create a stand alone application and not a web based app.

Why exactly did you think PHP was the best option for these tasks?

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
V,

Has to roll-out to over 20 non networked machines, so needs to run on all and WEB is only common linked source.

YMR
 
V,

Also all, but 2, machines are user machines, not developers, so do not have REXX/OO-REXX installed, so PHP/WEB is common to all.

I understand the server-side issue, but found several command and extensions in PHP that not only deal with Windows, but are at the machine specific level, so wondering why this is also not possible.

YMR
 
i'm a bit lost. but then i don't know what REXX is.

if you are trying to scan all client machines from a server, then i think that php can do that provided that each client is on the same subnet as the server and the php server process has the read credentials to access the root of each client.

there would be no need for the server to map directories though, UNC paths woud suffice.

i guess you could create path maps by firing off a set of system calls to 'net use'

it strikes me that it might be better though to force a login script through some group policy. the script would sort out the mappings and the scan and do anything else you want.
 
J,

You will find info on OO-REXX at:


Lang dev history is:

1. PL1,
2. REXX,
3. C/C++,
4. Java,
5. Perl,

or something like that, but since REXX was on Big Blue boxes natively, then Commodore Amigas, then PCs and IBM sales gurus did not know how to sell it, it did not hit mainstream though very powerful.

There is also WEB version name NETREXX.

Tek-Tips has a REXX developers thread.

YMR
 
I'm not sure what level of access you have to these machines, but PHP can be run from Command line in Windows (I believe it's native, but don't quote me =P).

It's been a few years, but if I recall correctly the script can be run indefinitely, so you could create a simple "Port Listener" for each computer, then using PHP send commands to the script which would preform whichever action you wanted.

I once built a simple chat handler on command line. It would listen for any input being sent (I was sending data via putty), then send it to any other connected users... Very simple, but sounds like it might be able to help you. Sorry for the lack of solid info though.
 
@Motolix

Welcome to the forum and to Tek-Tips

I absolutely do not want to dissuade you from posting or belittle your contributions to date, but personally I would prefer it if you read the prior contributions before posting.
 
all,

Back to my question of:
I understand the server-side issue, but found several command and extensions in PHP that not only deal with Windows, but are at the machine specific level, so wondering why this is also not possible.

Would I need an AJAX script to do this? I think all machines can do that, as all have WEB capability?

Alternate Q:
Does anyone have links to good Windows interaction scripts?

I think I lost the ones I had.

Thanks!

YMR
 
As a general rule, web browsers can't make changes to client machines (this might not be entirely true). I think any extensions your have found that deal with php and windows are run on the server (or wherever the php code is being run). So what you really need is an application written in a language that will run on windows and accomplish the tasks as described in your first post. You could use the web as a way to distribute the program, but it will need to be run on the client's machine. Does that make sense? Is that what you're looking for?

-----------------------------------------
I cannot be bought. Find leasing information at
 
YMR,

can you help with some more information? are all the machines on the same subnet?
if so, does the server machine have the right permissions to interact with the client (i.e. to access the admin share)?
 
All,

Sound like I need an AJAX component or script to run within my PHP code to do this. Does anyone know an AJAX snippet that does this?

YMR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top