x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

dUH. How to run .cmd files from a shortcut?

wally
wally Page Icon Posted 2005-06-26 3:34 PM
#
Status:
Ok, I can run my .cmd files from the console w/o a hitch, but I can't seem to create a working shortcut to run them from the desktop. I'm aiming to run a cleanup program at each boot.
Am I asking the impossible? What properties do I need in my shortcut?
 Top of the page
bobbarker
bobbarker Page Icon Posted 2005-06-26 3:42 PM
#
Status:
I'm sure just making a .bat file would work....but heck if I know if they work on HPCs and what not...check on google for how to make a batch file.
 Top of the page
wally
wally Page Icon Posted 2005-06-26 4:03 PM
#
Status:
I should clarify. .bat and .cmd are the same thing to the CE console. Both extensions mean the same thing AFAIK.

I have the file written and it executes fine from the console prompt but no shortcuts seem to work. I think I'm missing something simple.
 Top of the page
C:Amie Page Icon Posted 2005-06-26 4:10 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,990
Location:
United Kingdom
Status:
Send it to cmd.exe <path> rather than just <path>
 Top of the page
matrixcore Page Icon Posted 2005-06-26 4:22 PM
#
Avatar image of matrixcore
H/PC Elite

Posts:
627
Location:
The Matrix
Status:
wally - 2005-06-26 3:03 PM

I should clarify. .bat and .cmd are the same thing to the CE console. Both extensions mean the same thing AFAIK.

I have the file written and it executes fine from the console prompt but no shortcuts seem to work. I think I'm missing something simple.


Ok, i've tried and got to a possible solution
Get some app that can modify file associations (smalltweak, and there's another from M$FT). create a new filetype with the extensions ".cmd" and ".bat", in the execute command, you must type the following:
cmd /c %1

now create a simple batch file, with any of those extensions, and double click it in the CE explorer, if it works, then you can create shortcuts as you will do with any app

Hope this helps
 Top of the page
matrixcore Page Icon Posted 2005-06-26 4:29 PM
#
Avatar image of matrixcore
H/PC Elite

Posts:
627
Location:
The Matrix
Status:
C:Amie - 2005-06-26 3:10 PM

Send it to cmd.exe <path> rather than just <path>


C:Amie= That'll not work in my J728, i've tried and it fails miserably with the following message
Unrecognized option <path to file>
 Top of the page
wally
wally Page Icon Posted 2005-06-26 5:03 PM
#
Status:
Thanks to all for helping. I have a working solution.

My shortcut property is simply

"cmd" /c "path\cmdfile.cmd"

and it works. The shortcut is a generic icon that displays an error message when I examine the properties, but it runs when clicked and that's all I care about for now.

Nice, now with a desktop shortcut I can empty my IE & Netfront caches and my temp dir in one easy go and reclaim the memory. Kind of like Memaid for the PPC

Now to see if it will work for me when I soft reset.
 Top of the page
matrixcore Page Icon Posted 2005-06-26 5:10 PM
#
Avatar image of matrixcore
H/PC Elite

Posts:
627
Location:
The Matrix
Status:
Glad it worked for you!
 Top of the page
wally
wally Page Icon Posted 2005-06-26 5:19 PM
#
Status:
Sorry, it was ignorant of me not to include the batch file for the benefit of others:
Type the following three lines and make sure you save the file as text format with .cmd extension.

echo y | del \"program files\netfront3\cache"
echo y | del \windows\profiles\guest /s
echo y | del \temp

You can save it anywhere. Now just create a shortcut to it as indicated above and voila, lots of precious memory reclaimed in a blink. Much easier than exploring and emptying the dirs by hand.

Now that I can execute .cmd files from a shortcut I have a million things to implement with them.
The possibilities are limitless
 Top of the page
takwu Page Icon Posted 2005-06-27 6:33 AM
#
Avatar image of takwu
H/PC Elder

Posts:
1,953
Location:
BC, Canada
Status:
mmm, do you really have to echo y | into the del?
I mean can't you use the /q "quiet mode"?
 Top of the page
wally
wally Page Icon Posted 2005-06-27 3:57 PM
#
Status:
Dunno. Old habits die hard and I never tried the /q switch before.
LMK if the /q works. Tho I think it will stop and prompt you for confirmation.
 Top of the page
Jump to forum:
Seconds to generate: 0.188 - Cached queries : 63 - Executed queries : 8