Jump to content

gunsmokingman

Super Moderator
  • Posts

    2,296
  • Joined

  • Last visited

  • Donations

    0.00 USD 
  • Country

    Canada

Everything posted by gunsmokingman

  1. Aloha Aloha would you like a warning for not posting relative information about Start Is Back? This is a sub forum for Windows 8 is correct, but this thread is about Start Is Back only, it for a Tihiy to develop an application for Windows 8 users. This is not a thread for 1:\ Rumours about Microsoft Alpha Operating System 2:\ About Service Pack for Windows 8 3:\ People whining because they do not like the Admin decisions stelian88 , you are only just posting rumours from around the web about Windows 9 and or Windows Blue, and that is not adding anything to help Tihiy in the testing and development of Start Is Back for Windows 8 and that is why I raised your warning level.
  2. If you can not add to this thread relative information about StartIsBack then I will ban you.
  3. I was able to add Delete It to the context menu where Open and Edit are located. Thank you , I used * Reg key to add Delete it How To Add 1:\ Copy Application to Windows or Windows\Systen32, I used the Window folder 2:\ Open Reg Edit Expand HKEY_CLASSES_ROOT\* 3:\ Add a Key inside the Registry Shell Folder , this is also the name on the context menu Example Delete It 4:\ Create a key in inside of step 3 called command and fill in the Default with Example C:\Windows\DeleteIt.exe "%1" Reg Key Delete It Added
  4. Thank you for all the information Here is a link for Fast Explorer for those that want to try it.
  5. Does anyone know the Reg Key for the file Command Context Menu for files I added this for folders and it works, thank you for the information on how to do it. I have the DeleteIt to work from the SendTo Folder but would like it on the context menu underneath the create shortcut Is it possible to have the icon appear with the Delete It on the context menu, like the Microsoft Security Essentials
  6. It not second rated now you are using the correct object for the tasks. You could use ExpandEnvironmentStrings to get the w6432, it uses the process environment. My only critique is instead of alert it might of been nicer to have it display the information in the HTA. Example <!-- Hta And Script By Gunsmokingman Aka Jake1Eye This code is property of Gunsmokingman and Or Jake1Eye and you must have his permission to use. This is only posted as example code and meant only to used as such.--><TITLE>Test</TITLE><STYLE type="text/css">Body{Padding-Top:5pt;Padding-Bottom:1pt;Margin:1pt;Font-Size:10.25pt;Font-Weight:Bold;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;Color:Black;BackGround-Color:#EFE9E3;Text-Align:Center;Vertical-Align:Top;}DIV{Font-Size:9.25pt;Font-Weight:Bold;Color:#008181;Font-Family:Segoe Ui, Arial,Tahoma,Comic Sans MS;width:250;}</STYLE><script LANGUAGE='JScript'>//-> Resize And Place In Approx centerwindow.resizeTo(327,150)window.moveTo(screen.availWidth/2-(327/2),screen.availHeight/2-(150/2))//-> Onloadwindow.onload=function(){var Act = new ActiveXObject("WScript.Shell");var Env = Act.Environment("System")var W6432 = Act.ExpandEnvironmentStrings("%PROCESSOR_ARCHITEW6432%");Tx1.innerHTML= '<TABLE>PROCESSOR_ARCHITECTURE=['+Env("PROCESSOR_ARCHITECTURE")+']<TABLE>'+'<TABLE>PROCESSOR_ARCHITEW6432=['+W6432+']<TABLE>'}</SCRIPT><BODY><DIV ID='Tx1'> </DIV></BODY>
  7. bphlpt any Cmd prompt code must of been correct or Yzöwl would of said something Your hta was correct, retrieving the correct information, it just in VBS JS Environments there more information to access than Cmd, that where the confusion sets in. As you see there are a couple of Environments, and I have not tested them all and only these two Process and System and they return different results depending on what Environments it was being processed by. See you, learned something new from all this.
  8. 1:\ Wow trying to put words into my mouth. Please show me anywhere in this thread where I used the code you posted, and said the results are always correct. 2;\ Dim Act :Set Act = CreateObject("Wscript.Shell") Dim SysVar : Set SysVar = Act.Environment("System") Now lets get this correct when I mention PROCESSOR_ARCHITECTURE it in the above context. Show me anywhere in this thread where I posted second rated code that you produced for your test and got the correct results, they are correct you just do not understand the context. Do you know what environment ExpandEnvironmentStrings access? ExpandEnvironmentStrings Method You shown you don't read my links here a bit about what is access. 3:\ Perhaps if you had taken the time to read my link to the Environment Variables .You could of scripted something like below and show that if you used Process will return your results in the HTA that you produced. Dim Act :Set Act = CreateObject("Wscript.Shell") Dim SysVar : Set SysVar = Act.Environment("System") 'Dim SysVar : Set SysVar = Act.Environment("Process") If Right(SysVar("PROCESSOR_ARCHITECTURE"),2) = "64" Then WScript.Echo "64 Bit Os " & vbTab & SysVar("PROCESSOR_ARCHITECTURE") & _ vbCrLf & "CPU ID " & vbTab & SysVar("PROCESSOR_IDENTIFIER") & _ vbCrLf & "W6432 " & vbTab & SysVar("PROCESSOR_ARCHITEW6432") & _ vbCrLf & WScript.Path Else WScript.Echo "32 Bit Os " & vbTab & SysVar("PROCESSOR_ARCHITECTURE") & _ vbCrLf & "CPU ID " & vbTab & SysVar("PROCESSOR_IDENTIFIER") & _ vbCrLf & "W6432 " & vbTab & SysVar("PROCESSOR_ARCHITEW6432")& vbCrLf & WScript.Path End If Instead you go way out of context post something that I have not reference and using innuendo that I was at fault and wrong. Again show me where I used ExpandEnvironmentStrings in this thread and say it results are correct. Using the above code I tested on x86 and x64 OS and it always return the correct results, see if you can produce your results using my script and using System. I tried on 2 different OS and got always the correct results. Just for fun I made some minor changes check the results. Dim Act :Set Act = CreateObject("Wscript.Shell") Dim SysVar : Set SysVar = Act.Environment("System") 'Dim SysVar : Set SysVar = Act.Environment("Process") Dim A If Right(SysVar("PROCESSOR_ARCHITECTURE"),2) = "64" Then A = "64 Bit Os " & vbTab & SysVar("PROCESSOR_ARCHITECTURE") & _ vbCrLf & "CPU ID " & vbTab & SysVar("PROCESSOR_IDENTIFIER") & _ vbCrLf & "W6432 " & vbTab & SysVar("PROCESSOR_ARCHITEW6432") & _ vbCrLf & WScript.Path Else A = "32 Bit Os " & vbTab & SysVar("PROCESSOR_ARCHITECTURE") & _ vbCrLf & "CPU ID " & vbTab & SysVar("PROCESSOR_IDENTIFIER") & _ vbCrLf & "W6432 " & vbTab & SysVar("PROCESSOR_ARCHITEW6432")& vbCrLf & WScript.Path End If WScript.Echo A & vbcrlf & _ "Test W6432 : " & Act.ExpandEnvironmentStrings("%PROCESSOR_ARCHITEW6432%") Results x86 app x64 OS You can see I am getting the correct results using my scripting app output, you W6432 = AMD64 and Wscript Script Host W6432 = %PROCESSOR_ARCHITEW6432% and each show 64 Bit Os AMD64. var Act = new ActiveXObject("WScript.Shell"); var Env = Act.Environment("System") var a, b ="Test W6432\t" + Act.ExpandEnvironmentStrings("%PROCESSOR_ARCHITEW6432%") var A = new Array(Env("PROCESSOR_ARCHITECTURE"),"CPU ID \t"+ Env("PROCESSOR_IDENTIFIER"),"W6432 \t"+Env("PROCESSOR_ARCHITEW6432"), "App Path \t"+WScript.Path) function MyTest(a){if(Right(A[0],2) == "64") {a ="64 Bit Os \t"+A[0]+"\n\r"+A[1]+"\n\r"+A[2]+"\n\r"+ A[3]+"\n\r"} else {a ="32 Bit Os \t"+A[0]+"\n\r"+A[1]+"\n\r"+A[2]+"\n\r"+ A[3]+"\n\r"} return a + b} function Right(str, N){return str.substring(str.length, str.length - N);} WScript.Echo(MyTest(a)) Same script in Jscript returns the same results Now in these two scripts it really proves one thing and that is how wrong you are. Not really the SysVar("PROCESSOR_ARCHITEW6432") return nothing in either script
  9. 1:\ PROCESSOR_ARCHITECTURE is more than enough to determine if the OS is x86 or x64 2:\ W6432 does not work in VBS, any code posted in Cmd I tried always got more? on every line 3:\ PROCESSOR_ARCHITECTURE is not enough to determine if a individual process is x86 or x64 4:\ There Win32_Processor that has a way to determine OS Bitness, AddressWidth
  10. Truthfully I was expecting the AMD64 to be returned. I added a couple more line to get CPU ID and X6432, I was expecting that my CPU ID would be the same'. I also tested on my x64 adding Wscript.Path, my Scripting App is 32 bit X6432 this variable the only constant thing about it is value of Nothing, so it totally useless in a VBS environment. Here is a full list of Technet Environment Variables Here is my theory on a 32 bit OS the CPU is in x86 mode any will not run any 64 bit apps, on 64 bit OS you are running in x64 bit mode period. Individual process can exists in either 32 or 64 bit architecture on 64 bit OS. I would like to see someone install a x86 Os on to a x64 CPU and keep it at 64 bit and have more than 4 Gb of ram. This does not include using any type of virtual machine
  11. This was a quote from one of your another discussion link. I tested the script from my Win 7 desktop from a CD based 32 bit OS and as you can see it return the x86 or 32 bit, I have this CPU Type and it a 64 bit CPU. Let get this straight, this is the caption from David Wang HOWTO: Detect Process Bitness and not HOW TO Detect OS Bitness.
  12. bphlpt 1:\ Posted code in wrong language, the poster wrote this in VBS 2:\ What you posted was no better than my original post. 3:\ Microsoft you keep saying that, but you have not provided any links to support what you claim. 4:\ Geej and I have posted links to support our claims. 5:\ Yzöwl provided a Cmd script, of VBS from what I read the most accurate way to get OS bit
  13. So what you saying is that you would not remember that your variable was all lower case, what you said might of made sense if it was some kind of user input and case sensitivity. You already have 2 loops in your script, you should only need one. Loop 1 For Each objFile In objFolder.Files If LCase((objFileSys.GetExtensionName(objFile))) = LCase(EXT) Then EDICount = EDICount + 1 End If Next Msgbox "Detected EDI Files: " & EDICount Loop 2 For Each objFile In objFolder.Files If LCase((objFileSys.GetExtensionName(objFile))) = LCase(EXT) Then Set strFileName = objFileSys.GetFileName(objFile) Set objFile = objFileSys.OpenTextFile(objFile) sContents = objFile.ReadAll objFile.Close Set objRegEx = CreateObject("VBScript.RegExp") objRegEx.IgnoreCase = False objRegEx.Global = True objRegEx.Pattern = "19\*\*" Set colMatches = objRegEx.Execute(sContents) If colMatches.Count >= 1 Then Msgbox colMatches.Count & " errors in " & strFileName & "." Else Msgbox "0 errors found in " & strFileName & "." End If End If Next This is why I said to rewrite your second loop to just show what files are being process, but it your script so it must work.
  14. 1:\ LCase(EXT) not needed because you have the variable in lower case already EXT = "edi" 2:\ Set strFileName = objFileSys.GetFileName(objFile) you have a variable but do not use it. 3:\Set objFile = objFileSys.OpenTextFile(objFile) where are the 1, 2, 8 Set objFile = objFileSys.OpenTextFile(objFile,1) would open file for reading 4:\ Suggest that you run your script second loop to see what files are being process before checking for errors. Example For Each objFile In objFolder.Files If LCase((objFileSys.GetExtensionName(objFile))) = LCase(EXT) Then wscript.echo ObjFile.Path End If Next
  15. Win32_Processor class (Windows) So this would be the most effective way of finding out if the OS is x86 or x64 Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\CIMV2") Dim Obj For Each Obj In Wmi.ExecQuery("SELECT * FROM Win32_Processor") If Obj.AddressWidth = "64" Then MsgBox "64 Os Bit : " & Obj.AddressWidth Else MsgBox "32 Os Bit : " & Obj.AddressWidth End If Next
  16. These are your words that you posted I still say you are wrong the below image show the PROCESSOR_ARCHITECTURE variable is returning AMD64 in VBS and CMD Prompt.. From you posted it should be x86.
  17. Wrong notice the script report AMD64, a script using WmiCodeCreator report 64 , System Properties show 64 Bit Os Geej is correct read what the MSDN AddressWidth is for
  18. My point was PROCESSOR_ARCHITEW6432 can not be used in VBS script, it return "" or 0 character length in VBS Example VBS Dim Act :Set Act = CreateObject("Wscript.Shell") Dim SysVar : Set SysVar = Act.Environment("System") If SysVar("PROCESSOR_ARCHITEW6432") = "" Then WScript.Echo "Empty Value No Information Test 1" Else WScript.Echo "Type : " & SysVar("PROCESSOR_ARCHITEW6432") End If If Len(SysVar("PROCESSOR_ARCHITEW6432")) = 0 Then WScript.Echo "Empty Value No Information Test 2" Else WScript.Echo "Type : " & SysVar("PROCESSOR_ARCHITEW6432") End If Returns Empty Value No Information Test 1 Empty Value No Information Test 2
  19. Can you read I said another way, as to how the poster posted, I never said the most accurate. If (objFileSys.FolderExists("C:\Program Files (x86)")) Then Here is a accurate ways of doing it, only valid on Vista and up This get the architecture of the operating system, as opposed to that of the processor. Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\CIMV2") Dim Obj For Each Obj In Wmi.ExecQuery("SELECT * FROM Win32_OperatingSystem") MsgBox Obj.OSArchitecture Next Another way to get the processor architecture used by the platform code Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\CIMV2") Dim Obj, Var For Each Obj In Wmi.ExecQuery("SELECT * FROM Win32_Processor") Select Case Obj.Architecture Case 0 : Var = "x86" Case 1 : Var = "Mips" Case 2 : Var = "Alpha" Case 3 : Var = "PowerPc" Case 5 : Var = "Arm" Case 6 : Var = "Itanium-based systems" Case 9 : Var = "x64" End Select Next MsgBox "Architecture Type : " & Var Another way this will return 32 Bit on a x86 OS and this 64 bit on X64 OS Dim Wmi :Set Wmi = GetObject("winmgmts:\\.\root\CIMV2") For Each Obj In Wmi.ExecQuery("SELECT * FROM Win32_Processor") MsgBox "Os Bit : " & Obj.AddressWidth Next I did not known about PROCESSOR_ARCHITEW6432, but using it returns 32 Bit Os : AMD64, I am on X64 Windows 7 Ultimate Dim SysVar : Set SysVar = Act.Environment("System") 'PROCESSOR_ARCHITECTURE If Right(SysVar("PROCESSOR_ARCHITEW6432"),2) = "64" Then WScript.Echo "64 Bit Os : " & SysVar("PROCESSOR_ARCHITECTURE") Else WScript.Echo "32 Bit Os : " & SysVar("PROCESSOR_ARCHITECTURE") End If Script Results
  20. 1:\ If you where to place this at the top of the script Set objShell = CreateObject("WScript.Shell") you would only need 1 instead of the 3 you have. 2:\ Here is another way to check if it X86 orX64 Os Dim SysVar : Set SysVar = Act.Environment("System") If Right(SysVar("PROCESSOR_ARCHITECTURE"),2) = "64" Then WScript.Echo "64 Bit Os : " & SysVar("PROCESSOR_ARCHITECTURE") Else WScript.Echo "32 Bit Os : " & SysVar("PROCESSOR_ARCHITECTURE") End If Produced this result 64 Bit Os : AMD64 3:\ it would be better to make a new Variable for this path, doing it the way you have it means you would have to change 4 things if the path changes. Using a variable means only changing one path for the whole script. Dim aPath :aPath=Chr(34) & "C:\Program Files\VMware\Infrastructure\Virtual Infrastructure Client\Launcher\VpxClient.exe" & Chr(34)
  21. You should always place CreateObjects at the top of the script area this way it will be able to be used by any function. The way you have it, you can only access that object inside that function. With all the Make Folders it would be better to make a function that only makes folders. Example Tested Code, will create this folder on D:\Hey I Passed A Varible To A Function, you could pass any path to that function and it checks to see if it does not exists, then creates the folder path passed to the function. Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject") MkFldr("D:\Hey I Passed A Varible To A Function") Function MkFldr(F) If Not Fso.FolderExists(F) Then Fso.CreateFolder(F) End Function It would be a good idea to clean up your code first than add any changes.
  22. Since most that code does only HTML, could you post what you need done. It to much for me to read. Try my HTA and see if that what you want.
  23. Thank you and if you ever need help, just post your problem, I or my fellow mods will do or best to try and help.
×
×
  • Create New...