March 29, 200521 yr HiQuick 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
March 29, 200521 yr 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; }
March 31, 200521 yr i just have wpi call a batch file.<{POST_SNAPBACK}>You could do that, but with many DOS-calls you quickly clutter your CD.I belive the inline way is more clean, but to each his own :-)
March 31, 200521 yr i definatley know what you mean but i only have to call 2 so its not a big pain for me.
June 4, 200521 yr @Stalkie: Thanks for the post.I was searching a long time for a solution to the problem of running commands directly in WPI.
Create an account or sign in to comment