(Update: Once you solve your problem, you might want to use wperl instead of perl. ActivePerl's wperl is identical to their perl, except it doesn't open a console window. By using wperl, you won't see the console blink in and out. )
When I misread your problem, I thought you might have found the following batch file useful.
(Update: Corion just informed me that cd /d drive:\path does the same as the following. )
@echo off
if (%1)==() (
cd
goto Exit
)
if (%1)==(/?) goto Usage
if not (%2)==() goto Usage
for %%p in (%1) do (
%%~dp
cd "%%~fp"
)
goto Exit
:Usage
echo usage: %0 [ {rel_path} / {abs_path} ]
echo.
echo Switches to current drive and the current dir to those
echo of the supplied path.
echo.
echo If no argument is supplied, displays the current dir.
:Exit
You can use it as follows:
mycd d:\
mycd "C:\Program Files"
# Start a shell in d:\
cmd /k mycd d:\
# Start a command in d:\
cmd /c mycd d:\ & mycommand args
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|