The Cache: Technology Expert's Forum
 
*
Welcome, Guest. Please login or register. September 16, 2019, 01:05:51 PM

Login with username, password and session length


Pages: [1]
  Print  
Author Topic: CMD shortcut!  (Read 2909 times)
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« on: May 07, 2010, 12:43:15 PM »

Hello friends!

How are you? I've been gone a long time... but here I am again... lol

 Smooch

Now moving on to the topic!

I'm trying to create a shortcut to run a php script on windows!

I'm doing like this :

right click > new > shortcut

and then write something like this

cmd.exe /k php E:\Backlinks\link.php

Then trying to run the shortcut:
the script is not executed!

any ideas or thoughts?

 Nerd
Logged

what's up?
nop_90
Global Moderator
Lifer
*****
Offline Offline

Posts: 2203


View Profile
« Reply #1 on: May 08, 2010, 01:28:58 AM »

easiest way is to make a bat file, then put shortcut to that.
Logged
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #2 on: May 08, 2010, 07:49:44 AM »

In my case, i have to link to the path of the php-cgi exe file

which is:

Quote
C:\Program Files\phpDesigner 2008\PHP\php-cgi.exe c:\php\helloworld.php

and it works that way... if i remembered more about the path commands
i could probably get it to behave like linux where i can just type php anywhere
and it work...

but if you make a shortcut to the php exe it will work that way too, or the
batch file that links out like my example above.
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #3 on: May 08, 2010, 10:01:44 AM »

Thanks bros!

I've managed to setup a bat file like nop suggested  Smooch

It looks like this

Code:
@echo off
ECHO Link Checker
CD E:\Backlinks\
php link.php

When I've runned for the first time all was ok ... but now when I run it ... the cmd window closes instantly and I can't see the results!

any ideas?

any advice is appreciated as always  Shocked
Logged

what's up?
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #4 on: May 08, 2010, 10:59:18 AM »

you could go a
Code:
echo press ctrl-z when done viewing.
copy con waste.txt

or

test.bat > results.txt

Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #5 on: May 08, 2010, 11:13:57 AM »

if you wanted to take it deeper, you could get into it like this and test variables, etc:

Code:
ECHO OFF
CLS
:TOP
ECHO ...............................................
ECHO PRESS 1 or 2 then press enter
ECHO ...............................................
ECHO.
SET /P M=Type 1 or 2 and then press enter
IF %M%==1 GOTO ONE
IF %M%==2 GOTO TWO
ECHO %M% was not a good thing to type. try again.
GOTO TOP
:ONE
ECHO ONE
GOTO DONE
:TWO
ECHO TWO
:DONE
ECHO %M% was a good thing to type.
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #6 on: May 08, 2010, 11:18:38 AM »

you could go a
Code:
echo press ctrl-z when done viewing.
copy con waste.txt

or

test.bat > results.txt



call test.bat > results.txt

works perfectly!

Thanks Phaeton!

By the way your nickname comes form volswagen phaeton ?  ROFLMAO

 Shocked
Logged

what's up?
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #7 on: May 08, 2010, 11:20:57 AM »

Supposedly phaeton was the planet that is now the asteroid belt...

Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
NYDAz
Expert
****
Offline Offline

Posts: 212

The Night Stalker


View Profile
« Reply #8 on: May 08, 2010, 11:22:52 AM »

Supposedly phaeton was the planet that is now the asteroid belt...



lmfao ... k

do the cha-cha with me

 
Logged

what's up?
Phaėton
Lifer
*****
Offline Offline

Posts: 555


⎝⏠⏝⏠⎠


View Profile
« Reply #9 on: May 08, 2010, 11:32:25 AM »

 

ill do it!
Logged

When I was your age we used to walk to the TV to change the channel....  _̴ı̴̴̡̡̡ ̡͌l̡̡̡ ̡͌l̡*̡̡ ̴̡ı̴̴̡ ̡̡͡|̲̲̲͡͡͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡͡ ̲̲͡▫̲̲͡͡ ̲|̡̡̡ ̡ ̴̡ı̴̡̡
Pages: [1]
  Print  
 
Jump to:  

Perkiset's Place Home   Best of The Cache   phpMyIDE: MySQL Stored Procedures, Functions & Triggers
Politics @ Perkiset's   Pinkhat's Perspective   
cache
mart
coder
programmers
ajax
php
javascript
Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS!