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.

Reg Key start a file and set also the Working Directory possible ?

Featured Replies

HI :)

Is it possible to Auto start a file with a Registry Key in RunOnce and set also the Working Directory for this file ?

Edited by Outbreaker

I think that start /Dpath command should work.

Of course they do…

@REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v TestEntry^
/d "CMD /C START /DC:\MyDocDir\ /MAX NOTEPAD.EXE">Nul

Just copy and paste this as two lines and save.

  • Author

THX.

Only one problem if ther is a space in the executable file then i can't get this to work.

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v TestEntry /d "CMD /C START /D"C:\MyDocDir" /MAX "Auto Installer.bat">Nul

EDIT:

OK i read that this will not work.

A workaround would be to rename the file to Auto_Installer.bat or to use the 8.3 compatible name AUTOIN~1.bat

Edited by Outbreaker

Yes it will work!

@REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v TestEntry^
/d "CMD /C START \"\" /DC:\Path\YourDir\ \"File Name.ext\"">Nul

As before paste the two lines into a new file and save as test_ent.cmd or similar.

  • Author

Nop i have also test this but it won't work because spaces are not supported in file names with this command.

Spaces are supported have you actually tried using the example I provided, you only need to change the paths and names etc. to suit your own.

@REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v TestEntry^
/d "CMD /C START \"\" /DC:\Users\Yz”wl\ \"E:\File Name.bat\"">Nul

The above has been tested successfully by me.

However, I see little point in using the start command path switch for setting the working directory of a batch file, that could be set directly in that batch file.

  • Author

OK strange on the internet i find users that say it will not work but now i found out that this was the error:

Not:

START

But:

START \"\"

grrr

THX for your help :)

The problem occurs because you have included double quotes around your file path. What happens is the the Start command sees the double quotes as ["title"] because you haven't already provided one. The usual method of preventing it is to create a title; I just made mine blank!

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.