Molecule Posted November 1, 2009 Posted November 1, 2009 98 user = 2000 noob heretrying to install w2k without a clue as to what a user account is, or an administrator (???) is ... I see a long learning curve ahead of me ... so here we goI have a batch which works in 98se, but doesn't work in 2000sp4. In w2k am logged on as administrator (the same account when I built the system, even though it sometimes tells me that I don't have sufficient rights!!)set d=C:\PathToTargetFilenircmd setfiletime %d%\KB123456.exe 01-02-2003 04-05-2006I am trying to set the creation and modified dates on a whole swath of hotfixes ... so that I can load them into the nLite hotfix window in chronological order ...can someone help me?
Yzöwl Posted November 1, 2009 Posted November 1, 2009 I thought that the date parameter was supposed to be in this format"dd-mm-yyyy hh:nn:ss"You don't appear to be using a time!SET TFP=C:\PathToTargetFileNIRCMD SETFILETIME "%TFP%\KB123456.exe" "01-02-2003 01:02:03" "04-05-2006 04:05:06"
Molecule Posted November 1, 2009 Author Posted November 1, 2009 (edited) thanks, Yzöwl!setfiletime in nircmd (great utility) apparently parses by spaces, so as long as there are no spaces in the filenames, and only dates with no times are used, quotes aren't needed. If time is left blank, it is set to 00h00m00s.thus, in 2000 using full path+filename (no spaces allowed) the following without quotes works OKrem the next line works in both w2ksp4 and 98senircmd setfiletime c:\PathToTargetFile\testfile.txt 01-02-2003 04-05-2006pausebut add the variable %TPF% and with or without quotes, something is jamming in 2000, but w98se runs OK ...set TPC=C:\PathToTargetFilerem the next line works in 98se, but not in w2nircmd setfiletime %TPC%\testfile.txt 01-02-2003 04-05-2006rem the next line works in 2k, but not in 98senircmd setfiletime "%TPC%\testfile.txt" "01-02-2003 00:00:00" "04-05-2006 00:00:00"Incidentally, in 98se, when the variable %TPF% is placed inside quote marks, it does't get recognized as a variable. In 2000 it does!And in 98se putting the %TPF% outside the quotes doesn't concatonate with a string that follows, when it is placed in quotes. thus the first line above runs OK in 98se, the second command doesn't.The same variable inside a quoted string in 2000, and voila ... it is recognized and contaconates! Very nice for when filenames have spaces in them!back to track ... any idea why the variable doesn't work ... on my system anyway ... maybe it is the way the parameters are passed from NT to nircmd?It's no big deal ... the core product updates are in their own subdirs, so this only applies to 20 or so files. I keep all my patches in hot and archive subdirs, so I can run those locally. just curious why a variable would get passed one way in 98se, but in another in 2000. Edited November 2, 2009 by Molecule
cluberti Posted November 2, 2009 Posted November 2, 2009 I'd guess this comes down to the fact that the command interpreter on 9x is "real" 16bit DOS, whereas on 2K it's just a 32bit NTVDM, and quotes have special meaning on an NT system whereas they would not on a 9x system if I remember back correctly. Technically, anything (literal, spaced text, or strings) that you want to pass as a parameter to an executable in a batch on an NT-based system is indeed the proper way to do it (you may not have to depending on the binary being run, but it would seem nircmd may need it - check the setfiletime command line from the site), so this may just be down to the command interpreter differences between a 9x system and one in an NTVDM.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now