
Agent Orange
Active Members-
Posts
95 -
Joined
-
Last visited
Profile Information
-
Interests
Fly Fishing, Computers
Agent Orange's Achievements

Wayfarer (2/7)
0
Reputation
-
Thanks Danny35d.....tried that just now and it did not fix the issue. There is no error....just doesn't work. Thanks,
-
Hey all... I am missing something here....I am trying to run a simple Run command for MS Network Load Balancing If the script cannot connect to the IP address and the port (in this case 80) then it should run a command to stop the NLB on that cluster node. The standard windows command prompt is c:\windows\system32\nlb.exe stop <cluster>:<node>....if I run this command on the server it works fine, if I replace the command with a message box it reponds that it cannot connact that ip/port so it should run the command when I replace the message box with the Run command....but nothing happens (ie the node is active active running the script. Here is the syntax on my command line: Run(@ComSpec & " /c" & 'c:\windows\system32\nlb.exe stop win2k8nlb:win2k8nlb2',"",@SW_HIDE) Here is the entire code: $g_IP = "IP HERE" ; Start The TCP Services ;============================================== TCPStartUp() ; Connect to a Listening "SOCKET" ;============================================== $socket = TCPConnect($g_IP, 80) If $socket = 1 Then MsgBox(1,"Invalid IP","Invalid IP") TCPCloseSocket($socket) TCPShutdown() Exit ElseIf $socket = 2 Then MsgBox(1,"Invalid Port","Invalid Port") TCPCloseSocket($socket) TCPShutdown() Exit ElseIf $socket = -1 Then ;MsgBox(1,"Invalid connection","Invalid connection") Run(@ComSpec & " /c" & 'c:\windows\system32\nlb.exe stop win2k8nlb:win2k8nlb2',"",@SW_HIDE) TCPCloseSocket($socket) TCPShutdown() EndIf Exit
-
That worked Jos....Thanks
-
The command I'm running on the workstation is net localgroup "power users" domain\user /add I'm not sure the syntaxt for this when put into the autoit code line. The options I've tried cause an error
-
I did try it and the command works fine from a command prompt on the workstation. It successfully completes and when I go into the Power Users Group I see the user in there. I can delete the user from the group and run from a command line and it will readd it. If I try to run it from the AutoIt script I get the error 2 and no user is added to the group. Thanks
-
Thanks for the response. Still didn't work, I got a return code 2 this time.
-
I'm getting this an error line -1 running the below code. Any one tell me what is wrong with the expression? Thanks $Username=InputBox("Client Username","Please type the client username so it can be entered into the Power Users Group.","") $RET = RunWait(@ComSpec & " /c " & "net localgroup power users mydomain\"$username" /add",@WorkingDir, @SW_SHOW) MsgBox(64, "Result", "Return code was: " & $RET)
-
Hello all- I'm trying to run a setup.exe file that has a transform file included with it. I can't see to get the script to run the install with the tranform attached. It gets an error that it can't find the file. Here is what I have. Run("I:\Install\OfficeENT03_admin\setup.exe TRANSFORMS=I:\Install\OfficeENT03_admin\HMNMH.MST /qb-") What is the correct syntax for this? thanks
-
I'm trying to write of script that will Open a text file and then go through it looking for a certain value for that line. If it finds that value then I need to it delete that line out of the text file and continue through the file until the end. I have some code that seems to do everything...but I can't figure out how to delete the lines. I'm attaching the code I've tried so far. I maybe doing this the wrong way....any ideas? $file = FileOpen("c:\file.txt", 1) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($file) If @error = -1 Then ExitLoop $result = StringInStr($line, "PHYSICIAN",0) If $result <> 0 then StringReplace($line," ","-") StringStripWS($line,8) oÝ÷ ØÚ-²êÞ¶hêÞ¶¬Ì!z·ßÙ¢wî±çZºÚ"µÍB[YÙ[[PÛÜÙJ ÌÍÙ[JB
-
JdeB- This is very close to what I want. However, it can't get it to assign a new array value, $i, for each entry. If I run this, even the AutoIT example, the value of $i is always zero. How can I get it to add one on each time without an error? Thanks
-
Ok, I have a text file that might have more than one entry that I need to save in a variable(s). The information I need is in the middle of the line(s) and is not always the same text. Here is a sample of the text batch file I need to read. @ECHO OFF IF not Exist z:\capture.exe GOTO END CLS Echo Printer Setup... Z:\CAPTURE L=1 Q=.ir-lj4-b04.context.sa /TI=10 /NB /NFF /NT Z:\CAPTURE L=2 Q=.ir-lj5-b10.context2.sa /TI=10 /NB /NFF /NT :END EXIT Notice that in this file example there are two capture statements. I need to read this file and assign the data between the q= and /TI entry on both lines to variables. So in this case .ir-lj4-b04.context.sa and .ir-lj5-b10.context2.sa are what I need. Any help would be greatly appreciated.
-
Locodarwin- Thanks so much for you help on this. The issue is the software that I'm importing this file into seems to only accept .csv file. Based on the code I've submitted so far, can you give me an idea of how I can get this file saved as a csv then change the formatting to SSN, then save that file again. I have tried and the formatting is not showing that it is changing to SSN in the csv. Thanks again.
-
Locodarwin- Ok, it looks like I have to convert this xls into a csv anyway and that will take care of the formula errors. Now I'm trying to prevent Excel from prompting me with the input boxes when trying to SaveAs a .csv file. If I can have the code open the xls file and saveas a csv file then do the format on the column it will work. Here is the code I have. #include <ExcelCOM_UDF.au3> ; Include the function collection ; Browse to file $sFilePath = FileOpenDialog("Open OHM Excel File","c:\","Excel (*.xls)") $oExcel = _ExcelBookOpen($sFilePath,1, False) Sleep(800) _ExcelBookSaveAs($oExcel,$sFilePath,"csv",0,1) Sleep(1000) _ExcelNumberFormat($oExcel, "000-00-0000", "A:A") $oExcel.Calculate Sleep(10000) _ExcelBookSave($oExcel, 0) _ExcelBookClose($oExcel,1,1) Exit oÝ÷ Ù8^Ë.z+¶Øb²X§y«¢+Ù}á± ½½MÙÌ ÀÌØí½á°°ÀÌØíÍ¥±AÑ °ÅÕ½ÐíÍØÅÕ½Ðì°À°Ä it is prompting me. Can I stop that from happening? Thanks
-
Thanks Locodarwin
-
Well, that still didn't change the way the data looks in the workbook cells. I think it is because the xls file coming out of PeopleSoft says that all those cells have formatting errors (ie the little green triangle in the upper left corner of every cell in that column). I can check the formatting of the cells and they now show that they are set to SSN format, but I'm not able to clear that error without double clicking each cell in the column #include <ExcelCOM_UDF.au3> ; Include the function collection ; Browse to file $sFilePath = FileOpenDialog("Open OHM Excel File","c:\","Excel (*.xls)") $oExcel = _ExcelBookOpen($sFilePath,1, False) Sleep(1000) _ExcelNumberFormat($oExcel, "000-00-0000", "A:A") $oExcel.Calculate Sleep(10000) _ExcelBookSave($oExcel, 0) _ExcelBookClose($oExcel,1,1) Exit Any idea on how to clear those error and recalculate for sheet? Thanks