use lib "C:\path\to\my\script"; #### use lib "C:/path/to/my/script"; #### @rem Change the directory to where this .cmd lives: cd /d %~dp0 @rem Launch the script perl -w myscript.pl %*