Computing.Net > Forums > Windows Vista > cmd line %1 not working

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

cmd line %1 not working

Reply to Message Icon

Name: digitalspectrum
Date: September 5, 2009 at 14:39:07 Pacific
OS: Microsoft Windows Vista Ultimate
CPU/Ram: 2 GHz / 3070 MB
Product: Gigabyte / Nvdaacpi
Subcategory: Software Problems
Tags: Vista, command line, cmd, batch, parameter
Comment:

(It's **** near impossible to search for this since "%" is ignored in almost all
search engines... )
I'm trying to use the very common "Print directory listing" context menu batch file in
Vista. However, %1 is not returning the directory I am selecting. I tested this by just
trying to echo or cd %1 and I just get blank output - if I put quotes around "%1", I
only get quotes (for echo). %0 still works and shows the batch file name, but no
parameters after that (1,2,3,4...) have any output (just says "echo is on"). Help?
Weird huh?

I have already added the shell command key for directories in the registry
(Printdir.bat)

Here's the test batch:

echo %1
dir %1 /-p /o:gn >"%temp%\Listing.txt"
start /w notepad "%temp%\Listing.txt"
del "%temp%\Listing.txt"
exit

BTW, sfc, AVG, and Mbam didn't find any problems. I'm running Vista Ult.SP1.

edited by moderator: language



Sponsored Link
Ads by Google

Response Number 1
Name: Razor2.3
Date: September 5, 2009 at 16:04:30 Pacific
Reply:

What does your HKEY_CLASSES_ROOT\Directory\shell\Print Directory Listing\command\(default) registry entry look like?


0

Response Number 2
Name: digitalspectrum
Date: September 5, 2009 at 20:55:03 Pacific
Reply:

default value is "Printdir.bat" (I have the batch file in c:\windows ).


0

Response Number 3
Name: Razor2.3
Date: September 5, 2009 at 21:47:17 Pacific
Reply:

Try changing it to:

"%systemroot%\printdir.bat" "%1"


0

Response Number 4
Name: digitalspectrum
Date: September 8, 2009 at 07:32:39 Pacific
Reply:

Ahah! That didn't quite work... gave me an error about not having
permission to access the specified folder - even on in my own
user directory. But I did find what works...

"Printdir.bat" "%1"

Thank you for your time and effort and hopefully this will help
someone else out.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


insufficient storage on s... Pictures on internet site...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows Vista Forum Home


Sponsored links

Ads by Google


Results for: cmd line %1 not working

SoundMax outputs not working www.computing.net/answers/windows-vista/soundmax-outputs-not-working/1064.html

Mouse and Keyboard not working www.computing.net/answers/windows-vista/mouse-and-keyboard-not-working/3233.html

Line-in Not Working www.computing.net/answers/windows-vista/linein-not-working/3713.html