MacNuttin
asked on
Batch file add a parameter
my batch file:ungz.bat
c:\share\pacl\paext -p"c:\share\archive" c:\share\winzip100.exe.gz
del c:\share\winzip100.exe.gz
I call it with CMD c:\share\ungz.bat
I want to pass it a filename:
call it with CMD c:\share\unzip.bat myfile.gz
and have it do this:
c:\share\pacl\paext -p"c:\share\archive" c:\share\myfile.gz
del c:\share\mfile.gz
c:\share\pacl\paext -p"c:\share\archive" c:\share\winzip100.exe.gz
del c:\share\winzip100.exe.gz
I call it with CMD c:\share\ungz.bat
I want to pass it a filename:
call it with CMD c:\share\unzip.bat myfile.gz
and have it do this:
c:\share\pacl\paext -p"c:\share\archive" c:\share\myfile.gz
del c:\share\mfile.gz
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
so this?
@echo off
::ungz.bat
::Usage command [command parameters]
REM This script decompresses gz files and puts them in the achive
c:\share\pac\paext -p"c:\share\archive" %1
del c:\share\ %1
:EOF
that should work
ASKER
problem with del path tried this and it does ok but I have pass it the filename with it's path
@echo off
::ungz.bat
::Usage command [command parameters]
REM This script decompresses gz files and puts them in the achive
c:\share\pacl\paext -p"c:\share\archive\" %1
cd share
del %1
:EOF
@echo off
::ungz.bat
::Usage command [command parameters]
REM This script decompresses gz files and puts them in the achive
c:\share\pacl\paext -p"c:\share\archive\" %1
cd share
del %1
:EOF
So if I understand your question, I think you want your batch file to be:
c:\share\pacl\paext -p"c:\share\archive" %1
del %1