#1 18 Feb 2021 11:10

Mae
New Member
Registered: 29 Apr 2018
Posts: 2

assoc errorLevel

# First:  Check ErrorLevel and set ErrorLevel

> echo %errorLevel%
2

> (call)
> echo %errorLevel%
1

> (call )
> echo %errorLevel%
0

# … now we know to set errorLevel to Zero: (call ) and set to one: (call)
# so we can use "assoc" command:

> assoc .jpg
.jpg=jpgfile

> echo %errorLevel%
1

> ftype jpgfile
Dateityp "jpgfile" nicht gefunden, oder diesem Dateityp wurde kein Öffnen-Befehl zugeordnet.

# my system is german and say me: no file-assoc found

> echo %errorLevel%
2

# can't find an Explanation of this behavior on "ss64.cmd.assoc" and "*.ftype"
# can you help me?
# THANX!

Offline

#2 18 Feb 2021 14:21

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,115
Website

Re: assoc errorLevel

The file type you are looking for is jpegfile not jpgfile, and thats why it threw an error,

The error codes for these commands don't seem to be documented anywhere, though perhaps we could work them out.
Also the file types can seemingly only be found by digging through the registry, (Windows 7 used to expose them in the file association settings dialogue.)

File associations seem to be one of the most crusty areas in Windows, I get the impression the developers just want to sweep it all under the carpet and discourage users from changing anything.

Offline

Board footer

Powered by FluxBB