Jump to content

It didn't work!


Recommended Posts

Thanks smashly.

It is important to learning that we make mistakes, we actually learn more from making mistakes than from never doing so. We probably get more than half a dozen problems per week relating to double quotes or the lack of, and it is good that a thread like this can be used to help others understand.

As a rule, your filepaths and the vast majority of your filenames are under your own control. I would therefore suggest that they never contain spaces. On some occasions however, it is beyond our control, which is why we have to use the escape characters.

Link to comment
Share on other sites


Look at it like this smashly.

%PP%\AVG Anti Virus Program\autoavgsetup.exe

would execute fine.

"%PP%\AVG Anti Virus Program\autoavgsetup.exe"

would also execute fine from RunOnceEx. Difference between two is quote marks.

I meant that is isn't necessary have a second set of quotes, unless the path has spaces AND it uses switches. The path does have spaces but doesn't have switches so you don't need a second set of quotes.

I would therefore suggest that they never contain spaces.

I second that, it's so much easier without.

Edited by T D
Link to comment
Share on other sites

You are still wrong, and here is some proof! I used the following batch file to represent the runonceex.cmd

@ECHO OFF

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx /V TITLE /D "Doing a Test" /F >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\000 /VE /D "Test App" /F >NUL
REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\000 /V 1 /D "D:\Program Files\Standalone\1by1\1by1.exe" /F >NUL

PING -n 11 LOCALHOST>NUL

RUNDLL32 iernonce.dll,RunOnceExProcess

GOTO :EOF

This is what happened when it ran

testapp8kd.th.gif

Now all I was running was a switchless exe with a space in the file path. Now try it yourself and report back!

Edited by Yzöwl
Link to comment
Share on other sites

Ok, sorry to everyone. I was wrong. I was confused between xcopy and reg adds. There shouldnt be any spaces in the path for reg adds. But when copying files it is ok using quotes. Again I was confused. We do learn from our mistakes. I was only trying to help. Topic closed! lol

Edited by X-Centric
Link to comment
Share on other sites

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...