o u rock jaclaz i understood it clearly .many regards to u...i have 1 more thing to ask suppose i have a folder on desktop "wpi" containing wpi.hta in it and $oem$ folder beside wpi folder containing runwpi batch file. could the same command will b used for opening the wpi.hta. for /f "delims=: tokens=1" %%i in ("%~dp0") do set drive=%%i: set wpipath=%drive%\wpi SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx REG ADD %KEY%\999 /V 1 /D "%wpipath%\WPI.hta" /f i m using this to run it from a cd but its not working on a desktop what changes should b applied plzzzzzz help me out a little more.thxxx.May God Bless u.