Jump to content

Recommended Posts

Posted

Hi

Quick question, is it possible to run dos commands from within WPI.

For example mkdir, I get an error message that it cant find the file.

Any ideas how to fix this? I dont really want to create cmd files to do the same thing.

Thanks


Posted

Most DOS functions isn't programs in 2k/XP, but only functions of CMD.

At the end of generate.js in your WPI/wpiscripts folder is a function called substituteCommand where those commands can be replaces.

About the makedir, I've changed the function a bit to this:

function substituteCommand(cmd)
{
var prog = path(cmd);
var firstToken = prog.substr(0,prog.indexOf(" "));
switch (firstToken.toUpperCase())
{
 case 'FILECOPY': prog = ("CMD /C " + prog.replace(/FILECOPY/gi,'copy')); break;
 case 'DIRCOPY': prog = ("CMD /C " + prog.replace(/DIRCOPY/gi,'xcopy') + "/I /E /Y"); break;
 case 'RENAME': prog = ("CMD /C " + prog.replace(/RENAME/gi,'ren')); break;
 // Additions by carsten@indysign.dk
 case 'DELETE': prog = ("CMD /C "+ prog.replace(/DELETE/gi, 'del') +" /q"); break;
 case 'MAKEDIR': prog = ("CMD /C "+ prog.replace(/MAKEDIR/gi, 'mkdir')); break;
}
return prog;
}

  • 2 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...