Content Type
Profiles
Forums
Events
Everything posted by Yzöwl
-
Else statements for MS-DOS?
Yzöwl replied to Kube's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
The only other thing to do is bite the bullet and accept that if someone wants to be called frog it isn't going to kill you or the script so don't bother checking it. You could then use the same structure you already have, with a few small tweaks. The improvement I'd suggest then is to extend your accepted greetings/feelings input using findstr. @Echo off&Setlocal Title Hello :P Color b Set "Ecko=Echo/&Echo/" :1 Set/p "Greet=Hello " %Ecko% Echo %Greet%|Findstr/ir "Hello \<Hi\> Bonjour Howdy Gday Ola\>">Nul||(%Ecko% Echo Incorrect greeting %Ecko% Goto 1) :2 %Ecko% Set/p "Feel=How are you? " Echo %Feel%|Findstr/i "Fine Good Great Cool Bad Cold Hot Weird Dunno">Nul||( %Ecko% Echo Feeling is not registered. %Ecko% Goto 2) %Ecko% Echo Oh so you're feeling %Feel%! %Ecko% Echo Just wondering... :3 %Ecko% Set/p "Nick=What's your name? " If /i Not "%Nick%"=="" Goto 4 %Ecko% Echo Don't be shy! Goto 3 :4 Title %Greet% %Nick%! %Ecko% Echo Hi %Nick%, My name is Command Prompt %Ecko% Pause %Ecko% Echo Bye %Nick%! %Ecko% Pause -
Else statements for MS-DOS?
Yzöwl replied to Kube's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
You cannot possibly list every known feeling nevermind all real names! Is there a particular reason why you cannot output a list/index of responses to choose from instead of trying to achieve the impossible? -
Else statements for MS-DOS?
Yzöwl replied to Kube's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I'm afraid you're not making this easy, it appears that you have an idea of what you wish to achieve, but you're keeping it to yourself and asking for information in small increments so as not to disclose it to us!Tell us exactly what you are trying to do and perhaps give us the entire script and not just portions of it. What do you mean by reference their input? This will ask the question and output the non empty Name, if the Name is empty it will ask the question again. (It uses the Else statement as mentioned in your opening post). @Echo off&Setlocal enableextensions :AskName Cls (Set/p NameIs=What is your Name? ) If Not "%NameIs%"=="" (Echo Hello %NameIs%!!!) Else (Goto AskName) Pause -
Else statements for MS-DOS?
Yzöwl replied to Kube's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
I'm a little confused about what you mean by an Else statement, (as you can see one isn't required). :4 Set/p "Hello=Good, What's your name? " If /i Not "%Hello%"=="Bob" (Echo Invalid Name!&Goto 4) :5 -
On behalf of the Membership, may I wish you a warm, (though somewhat belated), welcome.
-
There should be plenty here for you, welcome to our Forums.
-
May I wish you a belated welcome to our Forums. Thank you for the kind words and I hope you're enjoying your new employment.
-
Welcome to our Forums, I hope you benefit from your time with us.
-
Welcome to our Forums, here's hoping that your happiness stays with you.
-
Copy of the i386 folder on the hard drive?
Yzöwl replied to spinjector's topic in Unattended Windows 2000/XP/2003
The fact that you are using HFSLIP to slipstream your source does not make this a HFSLIP question. Adding and runnnig of scripts, infs etc. is standard practice during installations therefore the topic has been moved to the more general Unattended area. HFSLIP has documented location(s) for the placing of scripts, should you decide that this is the most appropriate route for you to take. -
I would try updating the driver first, the ones you need should be found here.
-
True. I've already put a couple of little tweaks in; I'll just add a rename too. I used to be a BFF (batch file freak) and it's been a joy to wander through this thing. ~thanks The renamed ISO is already catered for as above!
-
The code uses the HFSLIPCD part by default, this is user changeable in your case by placing your user defined string after ISONAME= in that ini file. (You must enter your required string there if you wish to change it, adding the iso extension shouldn't matter since the code is simply using the name without that extension as a replacement for what is currently reading HFSLIPCD, i.e. ISONAME=YOURSTRING in the ini file will produce an ISO with a name similar to this: YOURSTRING_07172009_13h15m.iso. Quickly looking at the code, it appears as if adding any character after OVERWRITEISO= in the ini file should name the finished file with whatever you have entered as ISONAME= also in that file, i.e. ISONAME=ChosenName.iso OVERWRITEISO=1 Also bear in mind that it is simply a file name, if you are not happy with the date and time additions, you can simply rename the file when the script has finished producing it.
-
ADI SoundMAX Driver not installing (solved)
Yzöwl replied to Toddy86's topic in Unattended Windows 2000/XP/2003
Which Manufacturer, Model and Chipset is your PC? The driver you need is probably a generic one but competing manufacturers often make incompatible ones with the same VEN\DEV but different SUBSYS. You'd need to be certain you were getting the correct driver before debugging any installation errors. -
To prevent the setup path being incorrectly seen as "Title", I'd suggest this instead start "" /wait "%Source%JW\STAGE5\office\setup.exe"You can obviously place your own Title between the first set of double-quotes too!
-
You appear to have got your Source and Destination file names for the copy/rename process the wrong way around. (So I cannot see how it could have worked at all). Try this [Version] Signature = "$Windows NT$" [DefaultInstall] Copyfiles = Wallpaper.CopyFiles [DestinationDirs] Wallpaper.CopyFiles = 10, Web\Wallpaper [SourceDisksNames] 1 = "WallPaper", win51ip, , \i386 [SourceDisksFiles] 51385_poster2000_1.jpg = 1 53279_poster2000_2.jpg = 1 56049_poster2000_3.jpg = 1 92511_4.jpg = 1 img11_11.jpg = 1 US-wp1_7.jpg = 1 US-wp2_8.jpg = 1 US-wp3_9.jpg = 1 US-wp4_10.jpg = 1 Waterfall_6.jpg = 1 Windows7_5.jpg = 1 [Wallpaper.CopyFiles] 51385pos_1.jpg, 51385_poster2000_1.jpg 53279pos_2.jpg, 53279_poster2000_2.jpg 56049pos_3.jpg, 56049_poster2000_3.jpg 925114_4.jpg img1111_5.jpg, img11_11.jpg USwp17_6.jpg, US-wp1_7.jpg USwp28_7.jpg, US-wp2_8.jpg USwp39_8.jpg, US-wp3_9.jpg USwp410_9.jpg, US-wp4_10.jpg Waterfal_10.jpg, Waterfall_6.jpg Windows7_11.jpg, Windows7_5.jpg
-
Null as delimiter?
Yzöwl replied to Valerie's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
My apologies, the example I provided was written and tested only on Vista! @Echo off&Setlocal enableextensions For /f "delims=" %%# In ('Fsutil Fsinfo Drives^|More') Do Call :_ %%# Goto :Eof :_ If %1' Neq ' (Echo/%1|Find "\">Nul&&( Echo/Set "drv=%1" )&Shift)&&Goto _like the previous example change line 6 to suit the task you need to perform on each result. @Bilou in answer to your question, I used %%$ and %%# in the same way as you would use %%b and %%a respectively. b, (second token), comes after a, (first token) $, (second token), comes after #, (first token) In that specific case Drives: was an unwanted first token -
Null as delimiter?
Yzöwl replied to Valerie's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Of course it depends upon what you specifically need to do with each outputted result! Here is an example without knowing the number of drives @Echo off&Setlocal enableextensions For /f "tokens=1* delims= " %%# In ('Fsutil Fsinfo Drives') Do Call :_ %%$ Goto :Eof :_ If %1' Neq ' ( Echo/Set "drv=%1" Shift)&&Goto _You would just change Line 6 to suit the task you need to perform on each result. -
Ignoring the 'if ACPIAPIC_UP' lines, because I have no idea what you mean, here's a basic copy .cmd file which may help: @Echo off&Setlocal If Exist %1 (Pushd %1) Else Goto :Eof Set "X_=X:\Path To\SP3_extracted\i386" For /f "tokens=*" %%# In ( 'Dir/b/s/ad^|Find /v /i "\Windows\System32\config"') Do Call :_T %%# Goto :Eof :_T Pushd %* For /f "tokens=*" %%# In ('Dir/b/a-d') Do If Exist "%X_%\%%#" Copy "%X_%\%%#" PopdYou'll need to change 'line 3' to the correct full path!
-
simple problems with vbscript
Yzöwl replied to bj-kaiser's topic in Programming (C++, Delphi, VB/VBS, CMD/batch, etc.)
Try either one of the following: oShell.Run "rasdial.exe" & " " & strConnection & " " & strUsername, 1, true oShell.Run("rasdial.exe" & " " & strConnection & " " & strUsername), 1, true -
How to know which partition is Active?
Yzöwl replied to MOONLIGHT SONATA's topic in Unattended Windows 2000/XP/2003
It didn't fail to work, I think it didn't do what you wanted from it. The script was actually returning the data for the Boot partition, the trouble is that in many cases there is only one boot partition, meaning that regardless of which partition you were currently booted to the result would be the same. I will return the code as was and provide this more compact solution to return the partition and disk of the currently booted system. @Echo off&Setlocal For /f "tokens=3,5,7 delims==#, " %%a In ( 'Wmic Path Win32_LogicalDiskToPartition Get Antecedent^, Dependent^ ^|Find "%SystemDrive%"') Do Set "drv=%%~c"&Set "dsk=%%a"&Set "prt=%%b) Echo/Booted to Partition %prt% on Disk %dsk% and assigned to Drive %drv% -
How to know which partition is Active?
Yzöwl replied to MOONLIGHT SONATA's topic in Unattended Windows 2000/XP/2003
you called… Try this: @Echo off&Setlocal For /f "skip=1 delims=" %%a In ( 'Wmic Partition Where "BootPartition=True" Get DeviceID') Do Call :GetEm %%a Echo/Booted to Partition %prt% on Disk %dsk% and assigned to Drive %drv% Goto :Eof :GetEm Set dp="%*" For /f "tokens=3,5,7 delims==#, " %%a In ( 'Wmic Path Win32_LogicalDiskToPartition Get Antecedent^, Dependent^ ^|Find %dp%') Do Set "drv=%%~c"&Set "dsk=%%a"&Set "prt=%%b) -
Regedit.com, to the best of my knowledge is not a proper Windows XP file! I'd strongly suggest you perform some malware checks.
-
Okay, before this topic gets as 'out of control' as your others, referenced above, I'll toss you a life line. Explain once only, fully and in good English, exactly what it is you want someone to do for you. In order to do this all pertinent information must be provided. This information will include, but will not be limited to, what you have so far, full file structures with real names as applicable, operating system(s) etc. If you are capable of doing that then you will be aided in your goal, otherwise I can only see a re-occurring pattern!