rusking Posted September 21, 2011 Share Posted September 21, 2011 As written here i am trying todo the php remote support. What i was wondering is in sections line $ret .= 'cd client && ..\\win\\'.filename7z ' a ' etc, why does the user use \\ instead of a single \ and whats with the &&? i have the original php file and it reads $ret .= shell_exec('cd client;' . $filename7Z . ' a '' etc Now i know the original was made for Xampp in windows but i can get it nor this guys version to work. I assume that the \\ and && are specific to windows file systems but i can figure out how. I am trying to modify it to work on my 2k8r2 server or win7(running xampp) but get dead ends in both places. My Ubuntu server is a whole diff animal. can anyone give me any guidance? original file location here Quote Link to comment Share on other sites More sharing options...
rusking Posted September 21, 2011 Author Share Posted September 21, 2011 Ok i have figured this out....the php itself is refrencing dos command incorrectly. I did this in dos Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\Xampp>cd\ C:\>cd C:\xampp\htdocs\remote\ C:\xampp\htdocs\remote>cd client && ..\win '..\win' is not recognized as an internal or external command, operable program or batch file. C:\xampp\htdocs\remote\client>cd client &&\win The system cannot find the path specified. C:\xampp\htdocs\remote\client>cd client && The syntax of the command is incorrect. C:\xampp\htdocs\remote\client>cd client The system cannot find the path specified. C:\xampp\htdocs\remote\client>cd.. C:\xampp\htdocs\remote>cd client && The syntax of the command is incorrect. C:\xampp\htdocs\remote>cd client && .. '..' is not recognized as an internal or external command, operable program or batch file. C:\xampp\htdocs\remote\client>cd \win The system cannot find the path specified. C:\xampp\htdocs\remote\client>cd win C:\xampp\htdocs\remote\client\win>dir Volume in drive C has no label. Volume Serial Number is 2CAB-D2CB Directory of C:\xampp\htdocs\remote\client\win 09/20/2011 08:31 PM <DIR> . 09/20/2011 08:31 PM <DIR> .. 09/20/2011 08:26 PM 543 helpdesk.txt 11/24/2009 11:50 AM 6,518 icon1.ico 11/24/2009 11:50 AM 2,550 icon2.ico 11/24/2009 11:50 AM 6,518 icon3.ico 11/24/2009 11:50 AM 245,760 winvnc.exe 5 File(s) 261,889 bytes 2 Dir(s) 72,537,120,768 bytes free C:\xampp\htdocs\remote\client\win>C:\xampp\7zip\7z.exe a C:\xampp\htdocs\remote\ inc\tmp c1234.7z helpdesk.txt icon1.ico icon2.ico icon3.ico winvnc.exe 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Scanning c1234.7z: WARNING: The system cannot find the file specified. Creating archive C:\xampp\htdocs\remote\inc\tmp.7z Compressing icon1.ico Compressing icon2.ico Compressing icon3.ico Compressing helpdesk.txt Compressing winvnc.exe WARNINGS for files: c1234.7z : The system cannot find the file specified. ---------------- WARNING: Cannot find 1 file C:\xampp\htdocs\remote\client\win>C:\xampp\7zip\7z.exe a C:\xampp\htdocs\remote\ inc\tmp\ c1234.7z helpdesk.txt icon1.ico icon2.ico icon3.ico winvnc.exe 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Scanning c1234.7z: WARNING: The system cannot find the file specified. Creating archive C:\xampp\htdocs\remote\inc\tmp\.7z Compressing icon1.ico Compressing icon2.ico Compressing icon3.ico Compressing helpdesk.txt Compressing winvnc.exe WARNINGS for files: c1234.7z : The system cannot find the file specified. ---------------- WARNING: Cannot find 1 file C:\xampp\htdocs\remote\client\win>C:\xampp\7zip\7z.exe a C:\xampp\htdocs\remote\ inc\tmp\c1234.7z helpdesk.txt icon1.ico icon2.ico icon3.ico winvnc.exe 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Scanning Creating archive C:\xampp\htdocs\remote\inc\tmp\c1234.7z Compressing icon1.ico Compressing icon2.ico Compressing icon3.ico Compressing helpdesk.txt Compressing winvnc.exe Everything is Ok C:\xampp\htdocs\remote\client\win>C:\xampp\7zip\7z.exe a C:\xampp\htdocs\remote\ inc\tmp\c1234.7z helpdesk.txt icon1.ico icon2.ico icon3.ico winvnc.exe 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 Scanning Creating archive C:\xampp\htdocs\remote\inc\tmp\c1234.7z Compressing icon1.ico Compressing icon2.ico Compressing icon3.ico Compressing helpdesk.txt Compressing winvnc.exe Everything is Ok C:\xampp\htdocs\remote\client\win>cd\ C:\>cd . C:\>cd C:\xampp\htdocs\remote\ C:\xampp\htdocs\remote>cd .. C:\xampp\htdocs>cd C:\xampp\htdocs\remote\ C:\xampp\htdocs\remote>cd built C:\xampp\htdocs\remote\built>copy /b \support\7zS.sfx+ \client\config.txt+ C:\xa mpp\htdocs\remote\inc\tmp\c1234.7z c1234.exe The system cannot find the path specified. C:\xampp\htdocs\remote\built>copy /b C:\xampp\htdocs\remote\support\7zS.sfx+ C;\ xampp\htdocs\remote\client\config.txt+ C:\xampp\htdocs\remote\inc\tmp\c1234.7z c 1234.exe The syntax of the command is incorrect. C:\xampp\htdocs\remote\built>copy /b C:\xampp\htdocs\remote\support\7zS.sfx+ C:\ xampp\htdocs\remote\client\config.txt+ C:\xampp\htdocs\remote\inc\tmp\c1234.7z c 1234.exe C:\xampp\htdocs\remote\support\7zS.sfx C:\xampp\htdocs\remote\client\config.txt C:\xampp\htdocs\remote\inc\tmp\c1234.7z 1 file(s) copied. C:\xampp\htdocs\remote\built> And it made the file perfectly, the php cant achive this. So i changed the php to this $ret .= 'cd client' .$filename7Z.' a '.$tempFolder.'\c'.$sessionKey.'.7z helpdesk.txt icon1.ico icon2.ico icon3.ico winvnc.exe'; //compress vnc server and config files $ret .= 'cd built copy /b \support\7zS.sfx+ \client\config.txt+'.$tempFolder.'\c'.$sessionKey.'.7z c'.$sessionKey.'.exe'; //create executable in build directory $ret .= 'del /F /Q '.$tempFolder.'\\c'.$sessionKey.'.7z && '; //remove *.7z from %tmp% directory However the top line is getting a syntex error that i am apparently missing. I need to make it "cd client" then hit enter or ";" so i thought and then do the rest of line 1 and then 2. any ideas? Quote Link to comment Share on other sites More sharing options...
rusking Posted September 21, 2011 Author Share Posted September 21, 2011 note: above these line it states $ret = ''; but later down (after the lines) it states shell_exec($ret); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.