Click here to Skip to main content
15,887,477 members
Home / Discussions / Windows Development
   

Windows Development

 
AnswerRe: Windows 10 thread scheduling Pin
Richard Andrew x644-Mar-18 8:33
professionalRichard Andrew x644-Mar-18 8:33 
QuestionWindows 10 default image viewer Pin
A_Griffin7-Nov-17 22:39
A_Griffin7-Nov-17 22:39 
AnswerRe: Windows 10 default image viewer Pin
Richard MacCutchan7-Nov-17 22:48
mveRichard MacCutchan7-Nov-17 22:48 
GeneralRe: Windows 10 default image viewer Pin
A_Griffin7-Nov-17 22:55
A_Griffin7-Nov-17 22:55 
GeneralRe: Windows 10 default image viewer Pin
Richard MacCutchan7-Nov-17 23:27
mveRichard MacCutchan7-Nov-17 23:27 
QuestionWindows to ubunto Pin
Outh_Mane26-Oct-17 3:15
Outh_Mane26-Oct-17 3:15 
AnswerRe: Windows to ubunto Pin
Eddy Vluggen8-Nov-17 1:04
professionalEddy Vluggen8-Nov-17 1:04 
QuestionGRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 3:09
kalberts30-May-17 3:09 
This is not a question - I just need to get some frustration out. And as a warning to other people about the problem.

I have this utility generating a batch file for setting environment variable values. (The need arises because under the Bamboo build system, any environment setting is lost from one job step to the next; each job step must set the environment variables anew - but this is of minor importance to the problem). PATH and SET commands are written to a file named on the command line - I usually name it setenv.bat - and then executed in every job step.

Only that some users, running this utility on their desktop machines, ended up with crazy environment settings, not at all those that the utility shold have generated. But the debugger showed the correct commands to be written to the file. The .bat file appeared to, in mysterious ways, being modified between being written and being executed on the next command line.

The problem occured on PCs running cmd.exe in the default working directory, that of cmd.exe itself - C:\Windows\System32. (Most users change the CWD of cmd.exe to C:\ or some project directory, but those who rarely use CLI systems may not care to.) Running the utility from any other directory worked fine, but not from C:\Windows\System32. setenv.bat was not written to the directory; it never appeared.

I suspected access right problems, but creating the file caused no error/exception. Maybe the physical file was not accessed (causing the exception) until the file was flushed? So I flushed the file explicitly before closing it. Still no exception.

After closing I checked for File.Exists("C:\Windows\System32\setenv.bat"). True - file exists. I tried to open it: Once again - successful. I could read the correctly written contents. The file was completely absent from C:\Windows\System32\, yet I could create it, write to it, close it, open it again and read C:\Windows\System32\setenv.bat... What the... ???

So I searched the entire file system for the file setenv.bat. The first occurence explained how the crazy, incorrect settings could be made: Some completely unreated job had left a setenv.bat file in a directory on the path. Then there was a second setenv.bat occurence: In C:\Windows\SysWOW64, with a last written time stamp revealing that is was our guy.

I haven't yet sat down to learn the relationhship between System32 and SysWOW64 (but I sure will do now!). Appearently, System32 is interpreted as one core set of files, plus some extra - but the extras depend on who is asking. When a .net application (such as my utilitiy) asks, it gets the core+extras named SysWOW64, and new files are written to the extra part. When Explorer asks, it gets the core + another set of extras which do not overlap the extras of SysWOW64. When cmd.exe asks, in spite of being located in System32, does not get the SysWOW64 extras, but the same extras as Explorer. (Is it not a 32 bit program, in spite of its location?).

A simple workaround is to write to .\setenv.bat rather than setenv.bat. Even though CWD is identical in my utility and in cmd.exe, the .\setenv.bat generated is distinct from the .\setenv.bat executed on the next line. You then get an error message because C:\Windows\System32\setenv.bat, in the cmd.exe understanding, isn't there. But my utility cannot tell you in advance - to it, C:\Windows\System32\setenv.bat IS there!
AnswerRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard Deeming30-May-17 4:35
mveRichard Deeming30-May-17 4:35 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 7:01
kalberts30-May-17 7:01 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard Deeming30-May-17 8:51
mveRichard Deeming30-May-17 8:51 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 22:50
kalberts30-May-17 22:50 
AnswerRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard MacCutchan30-May-17 4:37
mveRichard MacCutchan30-May-17 4:37 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 5:49
kalberts30-May-17 5:49 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard MacCutchan30-May-17 5:54
mveRichard MacCutchan30-May-17 5:54 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 7:26
kalberts30-May-17 7:26 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
RedDk30-May-17 7:42
RedDk30-May-17 7:42 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard MacCutchan30-May-17 8:44
mveRichard MacCutchan30-May-17 8:44 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
kalberts30-May-17 22:42
kalberts30-May-17 22:42 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Richard MacCutchan30-May-17 22:52
mveRichard MacCutchan30-May-17 22:52 
AnswerRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
Terry Perez8-Sep-17 4:00
Terry Perez8-Sep-17 4:00 
GeneralRe: GRRRR!! 32 bit / 64 bit file mappings... Pin
OriginalGriff14-Sep-17 21:56
mveOriginalGriff14-Sep-17 21:56 
QuestionDisable UAC for standard accounts in Windows 10 (Please read full post before replying. Thanks.) Pin
djdynamix18-Apr-17 8:01
djdynamix18-Apr-17 8:01 
AnswerRe: Disable UAC for standard accounts in Windows 10 (Please read full post before replying. Thanks.) Pin
Richard Deeming24-Apr-17 9:08
mveRichard Deeming24-Apr-17 9:08 
GeneralRe: Disable UAC for standard accounts in Windows 10 (Please read full post before replying. Thanks.) Pin
djdynamix30-Apr-17 6:06
djdynamix30-Apr-17 6:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.