Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo.
- set domain=%~n1
- set ext=%~x1
- echo %DOMAIN%
- echo %EXT%
- echo.
- D:Scriptstest>test.bat domain.com
- domain
- .com
- D:Scriptstest>test.bat domain.co.uk
- domain.co
- .uk
- @echo off
- cscript //Nologo test.js %*
- if (WScript.Arguments.Length > 0) {
- var arg = WScript.Arguments.Item(0);
- var index = arg.indexOf('.');
- if (index != -1) {
- var domain = arg.substring(0, index);
- var ext = arg.substring(index);
- WScript.Echo(domain);
- WScript.Echo(ext);
- } else WScript.Echo("Error: Argument has no dots: " + arg);
- } else WScript.Echo("Error: No argument given");
- C:Documents and SettingsWaqasDesktop>test.bat domain.com
- domain
- .com
- C:Documents and SettingsWaqasDesktop>test.bat domain.co.uk
- domain
- .co.uk
Add Comment
Please, Sign In to add comment