[Tool] Hide console (command line) windows run you batch files completely hidden
#21
Posted 29 June 2005 - 05:26 PM
I guess the only thing is to test it in cmdlines.txt. I'll do it this week, and post the results.
#23
Posted 07 July 2005 - 07:29 AM
"RunHiddenConsole.exe cscript.exe cmdlines.vbs"
and it didn't seem to run.. On the other hand I've been using this in my cmdlines.txt for months now and it works fine
"cscript.exe cmdlines.vbs"
RunHiddenConsole.exe is already contained with %systemroot%\system32 as I outlined in an earlier post in this thread. I'm trying to put in some debug code to verify all this, but my guess is that it's not running properly.
#24
Posted 07 July 2005 - 12:47 PM
runhiddenconsole wscript test.vbsworks, although I didn't test from cmdlines.txt
BTW, do you see any console windows when you run
"cscript.exe cmdlines.vbs"from cmdilnes.txt?
#25
Posted 07 July 2005 - 01:03 PM
#26
Posted 10 July 2005 - 11:04 PM
I tested the utility at T-12 tonight. The cmdlines.txt was
[Commands] "hidec.exe useraccounts.cmd" "hidec.exe choice.cmd"
Both batch files have executed; however, I saw the blinking windows. It's different from your results... Odd. Anyway, it doesn't work from cmdilens.txt at the moment.
#27
Posted 11 July 2005 - 03:05 AM
Though I wold like to see /d added.
/d
When done from the command line, it is the equivalent to doing a CD /D to that path.
So using the /D switch changes the current drive in addition to changing current
directory for a drive.
Ex.
C:\> runhiddenconsole /W /d"c:\Program Files\Mail" thunderbird.exe C:\Program Files\Mail> waiting for 5 seconds, press a key to continue ...
See it runs thunderbird and changed the directory all in one go.
So main it just saves time...
This post has been edited by war59312: 11 July 2005 - 04:25 AM
#28
Posted 11 July 2005 - 06:26 AM
VAD, on Jul 11 2005, 12:04 AM, said:
I tested the utility at T-12 tonight. The cmdlines.txt was
[Commands] "hidec.exe useraccounts.cmd" "hidec.exe choice.cmd"
Both batch files have executed; however, I saw the blinking windows. It's different from your results... Odd. Anyway, it doesn't work from cmdilens.txt at the moment.
<{POST_SNAPBACK}>
I'm running a VBscript from cmdlines.txt which necessitates "cscript" before the script name. It could very well be that executing the following from a command prompt would work
RunnHiddenConsole.exe "cscript vbscript.vbs"
But since every line within cmdlines.txt needs to be inside quotes to begin with I'm not sure you could get it to work. Does cmdlines.txt support nesting of quotes? I seriously don't have the time to test the theory out at the moment. Especially since I'm using a solution that works. Might not be as pretty, but it's working.
#29
Posted 11 July 2005 - 10:13 AM
war59312 said:
If you run the utility w/o parameters, you'll see the usage window.
I don't see the reason for the /d switch, because you can specify any path to the batch file or console app. You don't need to switch the drives. Also, Thnuderbird is not a console app, so what's the point?
@RogueSpear
You got a valid point. Indeed, the quotes in cmdlines.txt cause the problem.
I got another utilitty written by a different person
#30
Posted 13 July 2005 - 02:14 AM
#31
Posted 18 July 2005 - 06:42 AM
I like to integrate this great utility into a application build with Uniface, a 4GL toolbox.
Therefor I need a dll-version of this program.
I that possible? I'm not really into c++ and compiling stuff.
Perhaps you can tell me how I can compile a dll-version
Thanx in advance
Maarten
#32
Posted 13 August 2005 - 07:26 PM
Lostclown
#33
Posted 31 January 2006 - 07:06 AM
If you did could somebody possibly post an example. Im going to try it now and will let you know.
Oldman
#34
Posted 31 January 2006 - 07:16 AM
#35
Posted 01 February 2006 - 11:46 AM
[commands] "runhiddenconsole.exe /W useraccounts.cmd" "REGEDIT /S QikLanch.reg" "REGEDIT /S RegTweaks.reg" "REGEDIT /S QikLanch.reg" "runhiddenconsole.exe /W runonceex.cmd"
yes i know qiklanch is there twice, but it works so i leave alone
#36
Posted 02 February 2006 - 12:30 AM
This script make a cmd then the cmd file makes a text file that is ran then it deletes all the files
Save As HideWindowComSpec.vbs
Quote
VBS ="\HideWindowComSpec.vbs" : CMD1 = "\TestHideCmd.Cmd" '''' VARIBLES FOR THE SCRIPT
Set Act = CreateObject("Wscript.Shell") '''' OBJECT FOR THE SCRIPT
Set Fso = CreateObject("Scripting.FileSystemObject") '''' OBJECT FOR THE SCRIPT
Set Ts = Fso.CreateTextFile(SD & CMD1) '''' THIS BUILD THE CMD TO RUN THEN THE CMD BUILDS THE TEXT FILE
SD = Act.ExpandEnvironmentStrings("%Systemdrive%") '''' SET THE SYSTEM DRIVE TO SD
'''' WRITE THE CMD THEN RUNS IT
Ts.WriteLine "@Echo Off" & vbCrLf & "set D=%Date%" & vbCrLf & "Echo The Date : %D% > MyTextTest.txt" &_
"&& Echo User Name : %UserName% >> MyTextTest.txt && Echo Windows Dir : %Windir% >> MyTextTest.txt"
Ts.Close
'''' STARTS THE RUN AND DELETE PHAZE
Act.Run(SD & CMD1),Hide,True '''' RUNS THE CMD HIDDEN
Act.Run("MyTextTest.txt"),Norm,True '''' RUN THE TEXT FILE MADE BY THE CMD
Fso.DeleteFile(SD & CMD1) '''' DELETES THE FILES
Fso.DeleteFile("MyTextTest.txt") '''' DELETES THE FILES
If Fso.FileExists(SD & VBS) Then '''' CHECKS THEN DELETE THIS FILE
Fso.DeleteFile(SD & VBS)
End If
I have made the above script into a SFX file for those who want to try it
This post has been edited by gunsmokingman: 22 February 2006 - 02:41 AM
#37
Posted 02 February 2006 - 08:58 AM
Is Windows Scripting Host fully installed @T13 svcpack.inf or @T12 cmdlines.txt?
Have you already tried one of your vbs scripts during install (and not @RunOnceEx stage).
although i don't like vbs scripts (only because i have to learn the syntax first to understand what they do
This post has been edited by Bilou_Gateux: 02 February 2006 - 08:59 AM
#38
Posted 02 February 2006 - 09:07 AM
On Error Resume Next
Dim ws, fs, sysdrv, colDrives, objDrive, strSpace, strOEM
Set ws = WScript.CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
sysdrv = ws.ExpandEnvironmentStrings ("%SYSTEMDRIVE%")
Set colDrives = fs.Drives
For Each objDrive in colDrives
If objDrive.DriveLetter & ":" = sysdrv Then
strSpace = objDrive.TotalSize
objDrive.VolumeName = "OS"
End If
If fs.FileExists(objDrive.DriveLetter & ":\WIN51") Then strOEM = objDrive.DriveLetter & ":\OEM"
Next
'** Subroutine; Set the RunOnceEx key with values
Sub SetROE
Dim strKeyPath
strKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx\"
ws.RegWrite strKeyPath & "TITLE", "Performing Post-Setup Tasks", "REG_SZ"
ws.RegWrite strKeyPath & "001\", "Preparing the System" , "REG_SZ"
ws.RegWrite strKeyPath & "001\1", strOEM & "\001_Begin.vbs", "REG_SZ"
If strSpace > 10737418240 Then
ws.RegWrite strKeyPath & "010\", "Copying i386 to Local Drive" , "REG_SZ"
ws.RegWrite strKeyPath & "010\1", strOEM & "\010_CopySource.vbs", "REG_SZ"
End If
If strSpace < 42949672960 Then
ws.RegWrite strKeyPath & "020\", "Compress Select Directories", "REG_SZ"
ws.RegWrite strKeyPath & "020\1", strOEM & "\020_Compress.vbs", "REG_SZ"
End If
If fs.FileExists(strOEM & "\030_Streets.7z") Then
ws.RegWrite strKeyPath & "030\", "Microsoft Streets and Trips 2005", "REG_SZ"
ws.RegWrite strKeyPath & "030\1", strOEM & "\030_Streets.vbs", "REG_SZ"
End If
If fs.FileExists(strOEM & "\Student\Setup.exe") Then
ws.RegWrite strKeyPath & "040\", "Microsoft Student 2006", "REG_SZ"
ws.RegWrite strKeyPath & "040\1", strOEM & "\040_Student.vbs", "REG_SZ"
End If
ws.RegWrite strKeyPath & "050\", "Initial Hard Disk Defragmentation", "REG_SZ"
ws.RegWrite strKeyPath & "050\1", strOEM & "\050_1stDefrag.vbs", "REG_SZ"
ws.RegWrite strKeyPath & "060\", "Configure the Page File", "REG_SZ"
ws.RegWrite strKeyPath & "060\1", strOEM & "\060_PageFile.vbs", "REG_SZ"
ws.RegWrite strKeyPath & "070\", "Configure Accounts", "REG_SZ"
ws.RegWrite strKeyPath & "070\1", strOEM & "\070_ConfigAccounts.vbs", "REG_SZ"
End Sub
'** Run Tasks
SetROE
And here's my cmdlines.txt:
[Commands] "cscript cmdlines.vbs" "GoogleToolbar.exe /q /d" "PhotoStory3.exe" "WindowsJournalViewer.exe" "REGEDIT /S cmdlines.reg"
For some reason my switchless silent installers for PhotoStory 3 and Windows Journal Viewer do not work properly from svcpack.inf, but they run just fine from cmdlines.txt
This post has been edited by RogueSpear: 02 February 2006 - 09:11 AM
#39
Posted 02 February 2006 - 09:20 AM
#40
Posted 12 February 2006 - 03:18 PM
VAD, on Jun 28 2005, 03:19 AM, said:
Well, I don't know about that... I just tested it in RunOnceEx routine. I made two cmd files: each one would ping localhost 5 times and write the results into a different text file for each ping. I ran both files from RunOnceEx with /W switch, and although I couldn't really see the whole execution process, I could see the 10 files and their creation time.
The screenshot is attached (first one). As you can see, they are in a perfect time order. Now look at the second screenshot. The same files ran from RunOnceEx, but without the /W switch. Apparently, the files executed at the same time.
You may have a different testing technique, though, but I can't test this utility from svcpack.inf
I've also done a RunOnceEx test to check the /W switch works and output gets piped to a file (really important as it helps when debugging dodgy installs) and it seems to work. I'm just about to confirm it by testing my new install on VMware. Will post back results. This util could be just what I'm after.
This post has been edited by Dobby: 12 February 2006 - 03:19 PM
- ← Need help formatting a cmd in Runonce
- Unattended Windows 2000/XP/2003
- Can I preset desktop icon positions during unattended setup? →



Help


Back to top









