Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Dos Commands Inside Wpi?

Featured Replies

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

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;
}

i just have wpi call a batch file.

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 :-)

  • 2 months later...

@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

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.